使用t.co重写链接搜索推文

时间:2011-09-26 20:37:52

标签: twitter

刚刚注意到一个访问者在t.co /LINKHERE之后发布了一个由twitter重新编写的链接。如果你知道链接,有没有办法追溯到包含链接的推特消息?

4 个答案:

答案 0 :(得分:11)

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

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

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

  3. OAuth 1下拉菜单中选择Authentication,然后使用您的推特帐户进行授权。

  4. 选择GET /search/tweets.json api。

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

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

答案 1 :(得分:2)

以下是快速简便的方法:

  1. 转到:http://dev.twitter.com/rest/tools/console
  2. 服务:“api.twitter.com/1.1”

  3. 身份验证:OAuth 1,然后根据需要登录

  4. 确保选中GET并将https://api.twitter.com/1.1/search/tweets.json?q=http%3A%2F%2Ft.co%2F{**SUFFIX**}粘贴到“请求网址”框中。

  5. **SUFFIX**替换为t.co网址后缀。因此,如果您要搜索的网址为t.co/**N2ul8FFCxu**,则您粘贴的链接应如下所示:

  6. https://api.twitter.com/1.1/search/tweets.json?q=http%3A%2F%2Ft.co%2F{**N2ul8FFCxu**}

    1. 点击发送

    2. 打开新标签页并将twitter.com/**SCREEN_NAME**/status/**ID_STR**粘贴到地址栏

    3. 使用Response中的信息替换**SCREEN_NAME****ID_STR**。像这样:

    4. twitter.com/**twitter**/status/**526534593826938881**

答案 2 :(得分:2)

标准的Twitter搜索将会工作几天。

对于较旧的t.co链接,您可以尝试搜索 find-tco.appspot.com

答案 3 :(得分:0)

t.co链接确实出现在搜索中,所以如果你很好奇,你有大约一个星期的时间来找到它们,然后才能从搜索索引中删除它们。

例如: http://search.twitter.com/search.json?q=https:%2F%2Ft.co%2FGJMsIcM6

返回:

{
  "completed_in": 0.019,
  "max_id": 178215431251828740,
  "max_id_str": "178215431251828736",
  "page": 1,
  "query": "https%3A%2F%2Ft.co%2FGJMsIcM6",
  "refresh_url": "?since_id=178215431251828736&q=https%3A%2F%2Ft.co%2FGJMsIcM6",
  "results": [
    {
      "created_at": "Fri, 09 Mar 2012 20:27:24 +0000",
      "from_user": "kurrik",
      "from_user_id": 7588892,
      "from_user_id_str": "7588892",
      "from_user_name": "Arne Roomann-Kurrik",
      "geo": null,
      "id": 178215431251828740,
      "id_str": "178215431251828736",
      "iso_language_code": "en",
      "metadata": {
        "result_type": "recent"
      },
      "profile_image_url": "http://a0.twimg.com/profile_images/24229162/arne001_normal.jpg",
      "profile_image_url_https": "https://si0.twimg.com/profile_images/24229162/arne001_normal.jpg",
      "source": "<a href="http://twitter.com/tweetbutton" rel="nofollow">Tweet Button</a>",
      "text": "RT @raffi: “Twitter Catches the 'SPDY' Train” from @wired → http://t.co/suCbWWEl (& they reference my tweet! → https://t.co/GJMsIcM6)",
      "to_user": null,
      "to_user_id": null,
      "to_user_id_str": null,
      "to_user_name": null
    },
    {
      "created_at": "Fri, 09 Mar 2012 20:26:26 +0000",
      "from_user": "raffi",
      "from_user_id": 8285392,
      "from_user_id_str": "8285392",
      "from_user_name": "Raffi Krikorian",
      "geo": null,
      "id": 178215186921033730,
      "id_str": "178215186921033730",
      "iso_language_code": "en",
      "metadata": {
        "result_type": "recent"
      },
      "profile_image_url": "http://a0.twimg.com/profile_images/1270234259/raffi-headshot-casual_normal.png",
      "profile_image_url_https": "https://si0.twimg.com/profile_images/1270234259/raffi-headshot-casual_normal.png",
      "source": "<a href="http://twitter.com/tweetbutton" rel="nofollow">Tweet Button</a>",
      "text": "“Twitter Catches the 'SPDY' Train” from @wired → http://t.co/suCbWWEl (& they reference my tweet! → https://t.co/GJMsIcM6)",
      "to_user": null,
      "to_user_id": null,
      "to_user_id_str": null,
      "to_user_name": null
    }
  ],
  "results_per_page": 15,
  "since_id": 0,
  "since_id_str": "0"
}

您会看到搜索也会返回转推。