Created
May 15, 2010 19:58
-
-
Save n1k0/402376 to your computer and use it in GitHub Desktop.
retrieves latest 100 tweets for a given search in the twitter timeline
This file contains hidden or 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
<?php | |
$searchtag = '#plop'; | |
$tweets = json_decode(file_get_contents('http://search.twitter.com/search.json?rpp=100&q='.urlencode($searchtag))); | |
foreach ($tweets->results as $tweet) { | |
echo sprintf("@%s: %s\n", $tweet->from_user, (string) $tweet->text); | |
} |
This file contains hidden or 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
<?php | |
$searchtag = '#plop'; | |
$tweets = simplexml_load_string(file_get_contents('http://search.twitter.com/search.atom?rpp=100&q='.urlencode($searchtag))); | |
foreach ($tweets->entry as $tweet) { | |
echo sprintf("@%s: %s\n", $tweet->author->name, (string) $tweet->title); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment