|
Haven't registered yet? Do it here now!
|
unc0nnected
Joined: 17 Dec 2010 Posts: 27
|
|
|
|
|
|
|
Posted: Sat Jan 08, 2011 9:38 am Post subject: Automatically empty a feed |
|
|
|
|
|
|
|
|
|
|
What I want to do is take an RSS feed that only contains 1 item and repost that one item to another blog every day. The 1 item in the feed itself has it's date stamp updated everyday and contains php that is interrupted by the target blog and converted into data that is updated on the fly to fit the day.
The problem I have here is that once this one item has been posted BA won't post it agian unless I empty the feed and then recrawl it. So what is the best way to automatically empty a specific feed at the end of the day? Definitely appreciate any help you guys can give |
|
|
|
|
|
|
|
Atanasis Owner
Joined: 22 May 2004 Posts: 4284 Location: The Net
|
|
|
|
|
|
|
Posted: Sat Jan 08, 2011 6:52 pm Post subject: |
|
|
|
|
|
|
|
|
|
|
BA won't pick the entry again if it contains same title. If you have your software change the post title you will be fine.
There is no automatically empty feed function, sorry.. _________________ Thanks,
Kaktusan
|
|
|
|
|
|
|
|
unc0nnected
Joined: 17 Dec 2010 Posts: 27
|
|
|
|
|
|
|
Posted: Sat Jan 08, 2011 10:55 pm Post subject: |
|
|
|
|
|
|
|
|
|
|
Well I realized there was no simple way to automate that, I was hoping to setup a cron with wget or something along those lines to jerry rig this thing. I can get wordpress to exec php in the post body and in the excerpt so that it is dynamic on every repost but I still haven't figured out how to have the title do the same. Back to the drawing board. Unless there was a way to allow BA to post content with duplicate titles up |
|
|
|
|
|
|
|
|
|
|
unc0nnected
Joined: 17 Dec 2010 Posts: 27
|
|
|
|
|
|
|
Posted: Wed Jan 12, 2011 12:28 pm Post subject: |
|
|
|
|
|
|
|
|
|
|
Hmm, I think it's just a matter of clearing the correct data from the baentries table. Not sure how exactly, but that's what google is for.
And here are the results.. All I needed to do was write simple php script that cleared the entries for a specific feed and run that on a cron that coincides with how often I want to crawl the feed. I'm sure for someone that knows php this would have taken 2 minutes instead of the hours that I spent on it but here it is:
<?php
//Get the Feed ID Variable
$feedID = $_GET['feedID'];
// Connect to MySQL
mysql_connect("localhost","%db_user%","%db_password%")or die(mysql_error())
;
mysql_select_db("%database%")or die(mysql_error());
echo "Database Connection Established <BR>";
// Delete the entries of a specific feed
mysql_query("DELETE FROM baentries WHERE fid='$feedID'")
or die(mysql_error());
echo "Entries Cleared for Feed ID $feedID <BR>";
mysql_query("DELETE FROM bamdsums WHERE fid='$feedID'")
or die(mysql_error());
echo "Sums Cleared for Feed ID $feedID <BR><BR> and that makes us all done";
?>
It's setup so that you can specify the feed id in the url by passing on the variable like this:
domain.com/clearfeed.php?feedID=5 or whatever # your feed ID is
Obviously you're going to substitute the values in between the %'s with proper values from your setup
Looks to be working just fine for me so I hope this saves someone else the time that I went through to get it working |
|
|
|
|
|
|
|
|
|
|
unc0nnected
Joined: 17 Dec 2010 Posts: 27
|
|
|
|
|
|
|
Posted: Tue Jan 17, 2012 8:43 am Post subject: |
|
|
|
|
|
|
|
|
|
|
Ah, thank goodness for this.. I just moved servers and realized that I left about 50 cronjobs behind and was stumped trying to figure out how to get BA to automatically clear out 100's of feed's, reset dozens of campaigns and then recrawl them on a set schedule. Looks like I updated the php script to include campaigns as well which I'll include the code for below:
<?php
//Get the Feed ID Variable
$feedID = $_GET['feedID'];
$caID = $_GET['caID'];
// Connect to MySQL
mysql_connect("localhost","#USERNAME#","#PASSWORD#")or die(mysql_error());
mysql_select_db("#DATABASE#")or die(mysql_error());
echo "Database Connection Established <BR>";
// Delete the entries of a specific feed
mysql_query("DELETE FROM baentries WHERE fid='$feedID'")
or die(mysql_error());
echo "Entries Cleared for Feed ID $feedID <BR>";
mysql_query("DELETE FROM bacentries WHERE cid='$caID'")
or die(mysql_error());
echo "Campaign Entry Cleared for Cat ID $caID <BR>";
mysql_query("DELETE FROM bamdsums WHERE fid='$feedID'")
or die(mysql_error());
echo "Sums Cleared for Feed ID $feedID <BR><BR> and that makes us all done";
?> |
|
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2002 phpBB Group
|
|
|
|
| |