搜索带有 t.co 重写链接的推文

编程入门 行业动态 更新时间:2024-10-23 23:25:45
本文介绍了搜索带有 t.co 重写链接的推文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

刚刚注意到在 t.co/LINKHERE 一个由 twitter 重写的链接之后访问者激增.如果您知道链接,有没有办法追溯到包含该链接的 Twitter 消息?

解决方案

您可以使用 twitter API 1.1 执行此操作.使用 api 的最简单方法是通过 twitter API 控制台.以下是步骤:

转到 https://dev.twitter/rest/tools/console

Service 下拉菜单中选择 https://api.twitter/1.1.

Authentication 下拉菜单中选择 OAuth 1 并使用您的 Twitter 帐户进行授权.

选择GET /search/tweets.json api.

q 查询参数中输入 t.co 链接(例如 https://t.co/w6iqrcuZMA)(尝试同时尝试 http 和https 链接.在我的例子中,http 链接没有返回记录,而 https 链接返回了一些记录).所有搜索结果将以json格式返回.

现在要打开实际的推文,请使用此链接(当然要填充占位符):https://twitter/{user.screen_name}/status/{id_str}

Just noticed a spike of visitors following a t.co/LINKHERE a link re-written by twitter. Is there a way to track back to the twitter message that contained the link, if you know the link?

解决方案

You can do this using twitter API 1.1. The easiest way is to use the api is through the twitter API console. Here are the steps:

Goto https://dev.twitter/rest/tools/console

Select https://api.twitter/1.1 from the Service dropdown menu.

Select OAuth 1 from the Authentication dropdown menu and authorize with your twitter account.

Choose GET /search/tweets.json api.

Type the t.co link (e.g. https://t.co/w6iqrcuZMA) in q query parameter (Try both http and https links. In my case the http link returned no record while https link returned some records). All the search results will be returned in json format.

Now to open the actual tweet use this link (fill the placeholders of course): https://twitter/{user.screen_name}/status/{id_str}

这篇关于搜索带有 t.co 重写链接的推文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-29 16:12:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1192096.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重写   链接

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!