简体   繁体   English

如何使用Twitter搜索API获取推文视频和100多个推文

[英]How to fetch tweet video & more than 100 tweets using Twitter Search API

I am using https://api.twitter.com/1.1/search/tweets.json?q= ' . 我正在使用https://api.twitter.com/1.1/search/tweets.json?q= '。 $_POST['keyword'] . $ _POST ['keyword']。 ' to get the tweets of searched keyword. '以获取搜索关键字的推文。

I am able to get till 100 tweets but i need to display full 3,200 tweets. 我最多可以发表100条推文,但我需要显示完整的3200条推文。 how can i do with this? 我该怎么办? how to get video from the tweets? 如何从推文中获取视频?

For videos, Twitter still working on this and for time being video results are not coming in "Search API". 对于视频,Twitter仍在处理此问题,并且暂时在“搜索API”中未显示视频结果。 We can track this here(see at few last comments): https://twittercommunity.com/t/twitter-video-support-in-rest-and-streaming-api/31258/38 我们可以在这里进行跟踪(请参阅最后的评论): https : //twittercommunity.com/t/twitter-video-support-in-rest-and-streaming-api/31258/38

For more than 100 tweets, you can call API for next tweets as per below: 对于100条以上的推文,您可以按照以下方式调用API进行下一条推文:

  1. Find the the highest id( data[data.length - 1].id ) in the twitter results that you just retrieved with your query 在您刚刚通过查询检索的推特结果中找到最高的id( data [data.length-1] .id
  2. perform the same query with the "since_id" option set to the id you just found. 使用“ since_id”选项设置为刚刚找到的ID来执行相同的查询。

Ex: https://api.twitter.com/1.1/search/tweets.json?q=nature&since_id=602821207268921300 例如: https//api.twitter.com/1.1/search/tweets.json? q = nature since_id = 602821207268921300

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用Twython从twitter搜索或流式api获取超过100条推文 - how to get more than 100 tweets from the twitter search or streaming api using Twython NodeJS Twitter api 搜索 100 多条推文 - NodeJS Twitter api search more than 100 tweets 如何使用 twitter 搜索 API v2 和 Tweepy 获取 python 中的所有推文(超过 100 条)和关联的用户字段? - How to get all tweets (more than 100) and associated user fields in python using twitter search API v2 and Tweepy? 使用nodejs从twitter API中检索超过100条推文 - Retrieving more than 100 tweets from twitter API using nodejs twitter api 计数超过100,使用twitter搜索api - twitter api count more than 100, using twitter search api 如何使用 Twitter 搜索 API 获取具有给定主题标签的所有推文? - How to fetch all tweets with a given hashtag using the Twitter search API? 如何使用twitter4j获得100多个tweet结果 - How to get more than 100 tweet result using twitter4j 使用Twython无法获取100条以上的推文 - Unable to fetch more than 100 tweets using Twython 如何使用Twitter RubyGem检索100多个搜索结果 - How to retrieve more than 100 search results using Twitter RubyGem 在 python 3.6 中使用 twitter 流 API 获取推文时,如何搜索多个关键字? - How can I search for more than one keyword while fetching tweets using twitter streaming API in python 3.6?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM