当 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/