Created
April 3, 2011 17:03
-
-
Save nickyleach/900566 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
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