問題描述
我將如何使用 PHP 從多個 twitter 用戶中提取推文,并將它們作為一個組合列表的一部分顯示在我的頁面上?
How would I go about pulling in tweets from multiple twitter users with PHP and displaying them as part of one combined list on my page?
推薦答案
使用搜索 API 和布爾 OR 運算符.例如,這里是 CNN Breaking News 和 NPR All Things Considered 的 URL:
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
查詢是 URLEncoded 所以使用 Fiddler 工具 -> 文本編碼/解碼或你最喜歡的工具來查看純文本的正確格式是:
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
希望有所幫助.
這篇關(guān)于PHP Twitter API - 如何拉入多個用戶的推文?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!