PHP Twitter API-如何提取多个用​​户的推文? [英] PHP Twitter API - How to pull in multiple users tweets?

查看:86
本文介绍了PHP Twitter API-如何提取多个用​​户的推文?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将如何使用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最新新闻和NPR所有相关事项的网址:

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

查询是经过URL编码的,因此请使用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

希望有帮助.

这篇关于PHP Twitter API-如何提取多个用​​户的推文?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆