Skip to content

Commit

Permalink
Updated cron script
Browse files Browse the repository at this point in the history
git-svn-id: http://smob.googlecode.com/svn/trunk@331 e4a05299-234b-0410-97c5-bf58ad63ebc6
  • Loading branch information
apassant authored and janaya committed Mar 14, 2011
1 parent 884079b commit 725f4b5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- Geolocation of messages based on their presence data
- Ability to purge messages older than X days
- Ability to delete a message
- Creating a FOAF profile if not provided
- Updated installer
- Various bugfixes and code-cleaning

Expand Down
12 changes: 8 additions & 4 deletions cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@
require_once(dirname(__FILE__)."/config/config.php");

// Get tweets
$tweet = new SMOBTweet();
$tweet->getposts();
if(TWITTER_READ) {
echo 'on lit twitter';
$tweet = new SMOBTweet();
$tweet->getposts();
}

// Purge messages
SMOBTools::purge();

if(PURGE > 0) {
SMOBTools::purge(PURGE);
}

?>
3 changes: 1 addition & 2 deletions lib/smob/SMOBTools.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ public function version() {
}

// Remove posts older than X days
public function purge() {
global $purge;
public function purge($purge) {
if($purge > 0) {
$date = date('c', time()-$purge*24*3600);
$query = "
Expand Down

0 comments on commit 725f4b5

Please sign in to comment.