gpt4 book ai didi

javascript - Twitter Api 通过主题标签搜索

转载 作者:行者123 更新时间:2023-12-01 02:05:22 29 4
gpt4 key购买 nike

我究竟如何使用 Twitter API?网上的一切似乎都已经过时并且不起作用。我在开发者门户上创建了一个 Twitter 应用程序并获取了我的访问 token 等。我现在该怎么办?我正在尝试使用 JQuery 发出 ajax get 请求。但我要做什么请求呢?他们的文档完全是垃圾。

最佳答案

请引用the documentation

建议您可以使用网址的地方

https://api.twitter.com/1.1/search/tweets.json?q=%23superbowl&result_type=recent

获取带有 superbowl 主题标签的最新推文。

请注意,该网址中的 # 已被编码为 %23。您可以找到这些编码的引用 here .

根据文档,您可以执行以下不同的搜索操作:

Operator                            Finds Tweets...
watching now containing both “watching” and “now”. This is the default operator.
“happy hour” containing the exact phrase “happy hour”.
love OR hate containing either “love” or “hate” (or both).
beer -root containing “beer” but not “root”.
#haiku containing the hashtag “haiku”.
from:interior sent from Twitter account “interior”.
list:NASA/astronauts-in-space-now sent from a Twitter account in the NASA list astronauts-in-space-now
to:NASA a Tweet authored in reply to Twitter account “NASA”.
@NASA mentioning Twitter account “NASA”.
politics filter:safe containing “politics” with Tweets marked as potentially sensitive removed.
puppy filter:media containing “puppy” and an image or video.
puppy -filter:retweets containing “puppy”, filtering out retweets
puppy filter:native_video containing “puppy” and an uploaded video, Amplify video, Periscope, or Vine.
puppy filter:periscope containing “puppy” and a Periscope video URL.
puppy filter:vine containing “puppy” and a Vine.
puppy filter:images containing “puppy” and links identified as photos, including third parties such as Instagram.
puppy filter:twimg containing “puppy” and a pic.twitter.com link representing one or more photos.
hilarious filter:links containing “hilarious” and linking to URL.
puppy url:amazon containing “puppy” and a URL with the word “amazon” anywhere within it.
superhero since:2015-12-21 containing “superhero” and sent since date “2015-12-21” (year-month-day).
puppy until:2015-12-21 containing “puppy” and sent before the date “2015-12-21”.
movie -scary :) containing “movie”, but not “scary”, and with a positive attitude.
flight :( containing “flight” and with a negative attitude.
traffic ? containing “traffic” and asking a question.

关于javascript - Twitter Api 通过主题标签搜索,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50147108/

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