gpt4 book ai didi

jquery - Twitter json 不工作

转载 作者:行者123 更新时间:2023-12-01 04:57:35 24 4
gpt4 key购买 nike

我之前曾使用 JQuery 使用过 twitter JSON。但现在好像不行了。是 Twitter 服务器宕机了还是我做错了什么?

这是我的代码:

    //Twitter

$(function() {
var twitterBaseURL = 'http://twitter.com/status/user_timeline/archies4000.json?count=1&callback=?';
var html = '';
var num_of_tweets=0;
$.getJSON(twitterBaseURL, function(json) {
$.each(json, function(i, item) {
num_of_tweets=i+1;
var text = $.toLink(item.text);
var profileImageURL = item.user.profile_image_url;
var time_arr= item.created_at.split(" ");
var time=time_arr[1]+" "+time_arr[2];
html += '<p>' + text + ' on '+ time + '</p>';
});
$('#twt-desc').html(html);
$('#twt-pic').append('<img src="'+profileImageURL+'" alt="VPULTS" />');
});
});

我什至尝试直接在浏览器中输入 URL (http://twitter.com/status/user_timeline/archies4000.json?count=1&callback=?) 以在浏览器本身中获取 JSON。它显示:

({"errors":[{"message":"Sorry, that page does not exist","code":34}]});

谢谢。

最佳答案

我得到了答案...Twitter 最近做了一些整理工作:

https://dev.twitter.com/discussions/10803

URL 需要更改为:

https://api.twitter.com/1/statuses/user_timeline/username.json?count=1&callback=

感谢@Lloyd 为我指明了正确的方向

关于jquery - Twitter json 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13364755/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com