为什么此Twitter标准搜索JSON响应中的“ URL”没有价值?

时间:2019-01-12 03:22:23

标签: javascript arrays json twitter

我正在尝试在我的网站中实现一个Twitter时间轴。到每个单独的tweet的链接都不会像应有的那样显示在JSON响应中(根据文档)。

我正在建立一个网站,该网站基于包含特定短语的推文来实现Twitter时间轴。我从Twitter标准搜索API获得的JSON响应应该具有一个链接到该API在JSON响应中提供的每个推文的URL。除了我的情况,没有网址。

contributors: null
coordinates: null
created_at: ""
entities:
hashtags: [{…}]
symbols: []
urls: Array(0)
length: 0
__proto__: Array(0)
user_mentions: []
__proto__: Object
favorite_count: 0
favorited: false
geo: null
id: 
id_str: ""
in_reply_to_screen_name: null
in_reply_to_status_id: null
in_reply_to_status_id_str: null
in_reply_to_user_id: null
in_reply_to_user_id_str: null
is_quote_status: false
lang: "en"
metadata: {iso_language_code: "en", result_type: "recent"}
place: null
retweet_count: 0
retweeted: false
source: ""
text: ""
truncated: false
user: {id: , id_str: "", name: "", screen_name: "", location: "", …}
__proto__: Object

这是JSON响应(删除了用户的个人详细信息)(如果有任何用途)。我只是想知道是否还有其他人遇到过这个问题,以及他们如何解决了。我想这可能是身份验证问题,但我能够获取有关用户特定位置的信息,所以我不知道为什么它不会让我获取检索到的推文的网址。

谢谢!

1 个答案:

答案 0 :(得分:1)

您必须使用推文<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <div class="list"> <div class="item"> <div>Value <label> <input class="value" value="10" type="text"> </label> </div> <div>Max <label> <input class="max" value="50" type="text"> </label> </div> <div>% Complete <label> <input class="percent" type="text"> </label> </div> </div> <div class="item"> <div>Value <label> <input class="value" value="40" type="text"> </label> </div> <div>Max <label> <input class="max" value="50" type="text"> </label> </div> <div>% Complete <label> <input class="percent" type="text"> </label> </div> </div> </div>id自行创建URL

user.name

例如:

  • id ='1075805398714777600'
  • user.name ='StackOverflow'

https://twitter.com/StackOverflow/status/1075805398714777600