twitter - 如何从 twitter API 1.1 获取 twitter feed

标签 twitter

当 API 1.0 时,我有两个使用 twitter feed 的在线横幅(flash 和 HTML5)。 我们知道API 1.0可以直接通过URL获取Feed。 (就像:http://api.twitter.com/1/statuses/user_timeline/annrubin.json?count=3)

如何获取 XML 格式的 feed?因为flash横幅很难使用HTML代码。

最佳答案

您需要升级到 API 的 1.1 版本。它已经被贴满了API docs几个月来,1.0 API(您当前使用的 API)已被删除。

此外,twitter API 不再返回 XML 格式。他们做出了正确的决定,以 JSON 形式返回所有数据。来自 FAQ :

API v1.1 will support JSON only. We’ve been hinting at this for some time now, first dropping XML support on the Streaming API and more recently on the trends API. XML, Atom, and RSS are infrequently used today, and we’ve chosen to throw our support behind the JSON format shared across the platform. Consequently, we’ve decided to discontinue support for these other formats.

自 2013 年 6 月 11 日起,您无法再向 twitter API 发出客户端(JS/jQuery/AJAX)请求。您需要选择一种服务器端语言来发出经过身份验证的请求(如果您选择 PHP ,检查this link)。

关于twitter - 如何从 twitter API 1.1 获取 twitter feed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17166727/

相关文章:

twitter-bootstrap - 如何使用 angular-cli 自定义 bootstrap 4

javascript - 存储来自 twitter api javascript (nodejs) 的数据

python - 使用 Tweepy 更新了 Twitter 直接消息 API

javascript - jQuery Sortable 无法与 Twitter 嵌入推文一起使用

ios - ParseTwitterUtils 内部服务器错误

java - 管理从 Java EE 应用程序到 Twitter 流 API 的长期连接

ios - 在 iOS 上通过 twitter 登录并在我的服务器上进行身份验证

ruby-on-rails - Ruby on Rails 和 Twitter OAuth 的测试策略

php - Twitter REST API,更新状态?

python - 使用高级选项的 TwitterAPI 过滤器位置