nst / STTwitter

A stable, mature and comprehensive Objective-C library for Twitter REST API 1.1
BSD 3-Clause "New" or "Revised" License
999 stars 161 forks source link

getSearchTweetsWithQuery usage / behaviour #201

Closed MichealB1969 closed 9 years ago

MichealB1969 commented 9 years ago

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

ePirat commented 9 years ago

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.

MichealB1969 commented 9 years ago

Doh! Thanks that makes it clear and i can iterate results using the other method.

Thank you.