我使用帶有名爲Twython的Python庫的Twitter API從推文中提取URL。我使用home_timeline API並查看entities
來搜索URL。 通常情況下,entities
中的鏈接是正確的。但是,在某些情況下,鏈接是錯誤的。例如,這是從帳戶@WWF-Philippines
鳴叫: Tweet對象的實體部分錯誤的URL
當我將光標懸停在突出顯示的鏈接,它顯示shortened_url1
(我不能忍受這裏,因爲#2不允許)在狀態欄上。如果我點擊鏈接,它會打開一個外部的article。不過,如果我使用Twitter的API來查詢相應的鳴叫,這裏是我的鳴叫得到:
Need a guide to properly enjoy the great outdoors while minimizing human impact? This list is for you!\xe2\x80\xa6 shortened_url2
你可以在這裏看到shortened_url2是從懸停光標時顯示的真正的鏈接(shortened_url1)不同。如果我按照shortened_url2,它會打開相同的推文。 entities
部分的鏈接與此錯誤鏈接(shortened_url2)相同。
那麼Twitter API在這裏有什麼問題? 謝謝。
如何發佈你寫的一些代碼? – elena