2012-07-02 36 views
0

我試圖找到一種方法,只需向所有用戶發送推文。 JSON代碼將這些表示爲「to_user」null。例如,edent下面的推文向每個人發送推文,因此to_user = null。
我嘗試沒有成功的幾個備選方案:將Twitter API結果限制爲發送給所有用戶的推文(無@replies)?

http://search.twitter.com/search.json?q=to:null%20from:edent&result_type=mixed 
http://search.twitter.com/search.json?q=to:0%20from:edent&result_type=mixed 
http://search.twitter.com/search.json?q=to:%20from:edent&result_type=mixed 

{ 
     "created_at": "Thu, 28 Jun 2012 06:55:58 +0000", 
     "from_user": "edent", 
     "from_user_id": 14054507, 
     "from_user_id_str": "14054507", 
     "from_user_name": "Terence Eden", 
     "geo": null, 
     "id": 218236278402068480, 
     "id_str": "218236278402068480", 
     "iso_language_code": "en", 
     "metadata": { 
      "result_type": "recent" 
     }, 
     "profile_image_url": "http://a0.twimg.com/profile_images/2318692719/7182974111_ec8e1fb46f_s_normal.jpg", 
     "profile_image_url_https": "https://si0.twimg.com/profile_images/2318692719/7182974111_ec8e1fb46f_s_normal.jpg", 
     "source": "<a href="http://twitter.com/">web</a>", 
     "text": "RT @straczynski: @edent Clearly the man was ahead of his time.", 
     "to_user": null, 
     "to_user_id": 0, 
     "to_user_id_str": "0", 
     "to_user_name": null, 
     "in_reply_to_status_id": 218075066452287500, 
     "in_reply_to_status_id_str": "218075066452287488" 
    }, 

回答

4

如果你只是希望得到來自任何人都無法,使用/get/statuses/user_timeline REST API端點,而不是搜索API特定用戶的tweet。/get/statuses/user_timeline有一個exclude_replies參數,它應該可以做你想要的。

Search API沒有任何排除回覆的方法。您唯一的選擇是獲取與您傳遞的任何其他參數相匹配的推文,並在您的最後處理它們以刪除任何以「@」開頭的文本。

相關問題