2015-10-16 47 views
0

序言:Twitter搜索API,直到以來參數

  • 今天是2015年10月17日
  • 參數until與日期From 2015-10-08 to 2015-10-17的工作就好了
  • 參數until與日期小於2015-10-08不會在所有的工作

我在做什麼錯?我如何獲得日期範圍內的推文(超過10天)?

這裏是我的代碼:

var params = { 
    count: 3, 
    until: "2015-10-08", 
    from: "[any_random_user]" 
}; 

$.ajax({ 
    url: twitterApi + "search/tweets.json", 
    type: "GET", 
    dataType: "jsonp", 
    data: params , 
    success: function (response) { 
     console.log(response); 
    } 
}); 

PS https://dev.twitter.com/rest/public/search

PPS,我使用1.1版本的API。

回答

1

這是不可能的。正如您鏈接到的頁面所述,搜索服務僅限API用戶使用。

由於per the documentation

請記住,搜索索引中有一個7天的限制。換句話說,在超過一週的日期內不會發現任何推文。

如果您只對該用戶的Tweets感興趣,則可以下載個人用戶的Tweets(最多3,200人)。