Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/go/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery twitterapi返回一个空白页面_Jquery - Fatal编程技术网

Jquery twitterapi返回一个空白页面

Jquery twitterapi返回一个空白页面,jquery,Jquery,我记得几个月前用这个代码获取tweet状态 var url = "http://api.twitter.com/1/statuses/user_timeline/stackoverflow.json"; $.getJSON(url + "?callback=?", null, function(tweets) { for(i in tweets) { tweet = tweets[i]; $("#tweet-list").append(tweet.tex

我记得几个月前用这个代码获取tweet状态

var url =  "http://api.twitter.com/1/statuses/user_timeline/stackoverflow.json";
$.getJSON(url + "?callback=?", null, function(tweets) {
    for(i in tweets) {
        tweet = tweets[i];
        $("#tweet-list").append(tweet.text + "<hr />");
    }
});
var url=”http://api.twitter.com/1/statuses/user_timeline/stackoverflow.json";
$.getJSON(url+“?回调=?”,null,函数(tweets){
对于(我在推特中){
tweet=tweets[i];
$(“#推特列表”).append(tweet.text+“
”); } });

现在,由于API更改,它无法工作


有谁能告诉我该在JSFIDLE中做些什么更改,并可能添加一两条注释来说明您是如何做到的吗?

Twitter API版本1已被弃用。您将通过以下方式获得相同的结果:

https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=stackoverflow

但是,在没有身份验证的情况下,您无法检索API结果。看

哇!有没有演示twitter身份验证的示例?有,但大多数示例都是服务器端语言。除非您在服务器上使用node.js,否则无法单独使用JavaScript。那么,您希望以哪种语言作为示例?PHP?请参阅下面的讨论,了解仅对客户端进行身份验证不安全的原因:不,我刚刚开始使用客户端。所以让我先把我的头绕在它周围;)