剛剛注意到t.co/LINKHERE鏈接被twitter重新編寫的一個訪客大量涌現。如果您知道鏈接,是否有方法追蹤包含鏈接的Twitter消息?使用t.co重寫鏈接搜索推文
回答
你可以使用twitter API 1.1來做到這一點。最簡單的方法是使用API是通過twitter API控制檯。以下是具體步驟:
選擇
https://api.twitter.com/1.1
從Service
下拉菜單。從
Authentication
下拉菜單中選擇OAuth 1
並使用您的Twitter帳戶進行授權。選擇
GET
/search/tweets.json
api。鍵入
q
查詢參數的t.co鏈接(例如https://t.co/w6iqrcuZMA
)(嘗試HTTP和HTTPS鏈接。在我的情況下http鏈接返回任何記錄,而HTTPS鏈接返回一些記錄)。所有的搜索結果將以json格式返回。我們打開實際的tweet使用這個鏈接(補當然佔位符):
https://twitter.com/{user.screen_name}/status/{id_str}
看起來REST控制檯不再可用。 – Bonnici
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"
}
你會看到搜索返回銳推爲好。
{ 錯誤:[ { }消息:「Twitter REST API v1不再有效,請遷移到API v1.1。https://dev.twitter.com/docs/api/1.1/overview。」, code:68 } ] } – Ultrasaurus
是的,提到的API端點現在已經過期。您需要使用http://api.twitter.com/1.1/search/tweets.json?q=https:%2F%2Ft.co%2FGJMsIcM6,而不幸的是這種方式在瀏覽器中無法使用。嘗試使用https://dev.twitter.com/docs/api/1.1/get/search/tweets右側的OAuth工具生成有效的請求。 –
現在工作了! – skywinder
這裏的快速簡便的方法:
- 轉到:http://dev.twitter.com/rest/tools/console
服務:「api.twitter.com/1.1」
正宗ation:OAuth 1,然後登錄,如果您需要
確保選擇GET並將
https://api.twitter.com/1.1/search/tweets.json?q=http%3A%2F%2Ft.co%2F{**SUFFIX**}
粘貼到請求URL框中。用t.co URL後綴替換
**SUFFIX**
。所以,如果你要搜索的網址是t.co/**N2ul8FFCxu**
,您粘貼鏈接應該是這樣的:
https://api.twitter.com/1.1/search/tweets.json?q=http%3A%2F%2Ft.co%2F{**N2ul8FFCxu**}
單擊發送
打開新選項卡並將
twitter.com/**SCREEN_NAME**/status/**ID_STR**
粘貼到地址欄中將
**SCREEN_NAME**
和**ID_STR**
替換爲來自響應。就像這樣:
twitter.com/**twitter**/status/**526534593826938881**
標準的Twitter搜索將幾天的工作。
對於較舊的t.co鏈接,您可以嘗試使用 find-tco.appspot.com進行搜索。
- 1. 使用JavaScript解開t.co鏈接?
- 2. 解開鏈接到bit.ly的t.co鏈接
- 3. 搜索鏈接從文件
- 4. 文字鏈接重寫
- 5. 如何解開與Python的t.co鏈接?
- 6. 獲取Tweets沒有t.co鏈接
- 7. 推文鏈接
- 8. 使用g ++鏈接失敗搜索-lstdC++
- 9. 鏈接搜索和使用serachlogic
- 10. Rails 4使用elasticsearch搜索的鏈接
- 11. 使用javascript在鏈接中搜索
- 12. 如何搜索文本並填寫/點擊與Selenium的鏈接?
- 13. 將文本框鏈接到expedia.com搜索
- 14. MySQL搜索文本和鏈接表
- 15. 使用JavaScript來搜索頁面的鏈接文本
- 16. 搜索文本塊,使用PHP返回MP3鏈接
- 17. 使用html文件中的鏈接創建搜索框?
- 18. .htaccess搜索頁面重寫
- 19. 搜索表單Htacess重寫
- 20. 重寫搜索結果
- 21. 如何搜索推文?
- 22. Hibernate搜索與Eclipse鏈接
- 23. 搜索結果的鏈接
- 24. 搜索並插入鏈接
- 25. CodeIgniter鏈接到搜索
- 26. 搜索鏈接列表
- 27. 鏈接到Google搜索href
- 28. 單鏈接列表搜索
- 29. ElasticSearch - 使用搜索縮寫
- 30. 使用鏈接列表而不使用重複鍵的順序搜索
你的意思是以編程方式做到這一點,或者你只是想搜索search.twitter.com?據我所知,從t.co鏈接獲取推介推特的ID是不可能的(除非你是Twitter)。您最好的選擇是1)查看https://dev.twitter.com/docs/tweet-entities進行api搜索或2)搜索未縮短的網址,因爲我不相信t.co鏈接「在搜索中顯示「。 –
不,他們沒有。我認爲,如果一個字符串被匹配爲一個URL,它會被一個更簡潔的ID所取代,即使它出現在實際結果中,搜索也不會收到該ID。如果它有任何意義。實際上,由於URL縮短使用情況,我發現Twitter發佈了一些關於API的問題。我只是希望找到包含我網站URL的推文。 – santa
我覺得你的困境,Twitter很難找到事情的根源。將來,用您自己的某種獨特標識符分享每個鏈接可能是最容易的。例如,www.domain.com/page-1?ref=XYZ –