开发者

PHP Twitter API - How to pull in multiple users tweets?

开发者 https://www.devze.com 2022-12-28 07:55 出处:网络
How would I go about pull开发者_StackOverflowing in tweets from multiple twitter users with PHP and displaying them as part of one combined list on my page?Use the search API and boolean OR operator.

How would I go about pull开发者_StackOverflowing in tweets from multiple twitter users with PHP and displaying them as part of one combined list on my page?


Use the search API and boolean OR operator. For example here is the URL for CNN Breaking News and NPR All Things Considered:

http://search.twitter.com/search.json?q=from%3acnnbrk+OR+from%3anpratc

The query is URLEncoded so use Fiddler Tools -> Text Encode/Decode or your favorite tool to see that the correct format in plain text is:

q=from:cnnbrk+OR+from:npratc

Hope that helps.


You can also create a list of the accounts you are interested in and place a list widget on your page. No PHP needed.

http://help.twitter.com/entries/76460-how-to-use-twitter-lists

http://twitter.com/goodies/widget_list

0

精彩评论

暂无评论...
验证码 换一张
取 消