Search for tweets with t.co rewritten links

前端 未结 4 1335
孤街浪徒
孤街浪徒 2021-02-05 06:14

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

4条回答
  •  无人及你
    2021-02-05 06:21

    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:

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

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

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

    4. Choose GET /search/tweets.json api.

    5. 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.

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

提交回复
热议问题