getSearchTweetsWithQuery usage / behaviour
Closed this issue · 2 comments
Using getSearchTweetsWithQuery after successfully verifying twitterAPIAppOnlyWithConsumerKey does not appear to return expected results.
Example query criteria looks like this #research from:michealb1969 since:2015-01-01 until:2015-04-01 which can be checked using the twitter search https://twitter.com/search?q=%23research%20from%3Amichealb1969%20since%3A2015-01-01%20until%3A2015-04-01&src=typd
However when using the following, statuses is empty?
NSString *query = @"#research from:michealb1969 since:2015-01-01 until:2015-04-01";
NSString *searchQuery = [query stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[twitter getSearchTweetsWithQuery:searchQuery successBlock:^(NSDictionary *searchMetadata, NSArray *statuses) {
NSLog(@"Search data : %@",searchMetadata);
NSLog(@"\n\n Status : %@",statuses);
} errorBlock:^(NSError *error) {
NSLog(@"error: %@", error);
}];
I can verify that auth is ok as getUserTimelineWithScreenName returns results but really looking to use the query to give greater flexibility so would appreciate your thoughts?
Thanks,
Mike
The dates you are using are too far back to give any results. The Search available via API only goes back a few days or if you are lucky two weeks. Your range is about three months in the past.
Doh! Thanks that makes it clear and i can iterate results using the other method.
Thank you.