Skip to content

Instantly share code, notes, and snippets.

@nickyleach
Created April 3, 2011 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nickyleach/900566 to your computer and use it in GitHub Desktop.
Save nickyleach/900566 to your computer and use it in GitHub Desktop.
<?
include 'ActivityFeed.php';
$feed = new ActivityFeed();
$feed->add(123, 'Nicky followed Kelly', time() + 5);
$feed->add(123, 'Nicky followed Josh', time() + 10);
$feed->add(123, 'Nicky earned 1200 points for being awesome!', time() + 30);
$feed->add(456, 'Kelly checked-in at Starbucks', time() + 12);
$feed->add(456, 'Kelly commented: "This place is awesome!"', time() + 20);
$feed->add(789, 'Josh registered', time());
$feed->add(789, 'Josh updated his profile', time() + 45);
// Nicky's activity
print_r($feed->userActivity(123));
// Nicky's friends' activity
print_r($feed->usersActivity(123, array(456, 789)));
// Nicky's activity & his friends' activity
print_r($feed->usersActivity(123, array(123, 456, 789)));
// Nicky's activity filtered by time
print_r($feed->userActivity(123, null, time() + 15, time() + 5));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment