如何从推特 API 1.1 获取推特提要 [英] How to get twitter feed from twitter API 1.1

查看:38
本文介绍了如何从推特 API 1.1 获取推特提要的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have two online banner (flash and HTML5) using twitter feed when API 1.0 . We know that API 1.0 can get the feed by a URL directly. (Just like: http://api.twitter.com/1/statuses/user_timeline/annrubin.json?count=3)

如何获取 XML 格式的提要?因为 Flash 横幅很难使用 HTML 代码.

How can I get the feed like XML format? Because flash banner is difficult to use HTML code.

推荐答案

您需要升级到 API 的 1.1 版本.几个月来,API 文档中到处都是 1.0 API(你'正在使用) 正在被删除.

You need to upgrade to the 1.1 version of the API. It's been plastered all over the API docs for months that the 1.0 API (the one you're currently using) is being removed.

此外,twitter API不再返回 XML 格式.他们做出了以 JSON 格式返回所有数据的明智决定.来自常见问题解答:

Also, the twitter API no longer returns XML format. They made the good decision to return all data in JSON. From the FAQ:

API v1.1 将仅支持 JSON.一段时间以来,我们一直在暗示这一点,首先是在 Streaming API 和最近的趋势 API 上放弃 XML 支持.XML、Atom 和 RSS 现在很少使用,我们选择支持跨平台共享的 JSON 格式.因此,我们决定停止支持这些其他格式.

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,检查 这个链接).

You can't make client-side (JS / jQuery / AJAX) requests to the twitter API any more as of 11th June 2013. You need to pick up a server-side language to make authenticated requests (if you choose PHP, check this link).

这篇关于如何从推特 API 1.1 获取推特提要的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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