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

Can't search for both # and @ #124

Closed akeTML closed 10 years ago

akeTML commented 10 years ago

I call search api like this.

    [twitter getSearchTweetsWithQuery:queryString geocode:@"" lang:@"" locale:@"" resultType:@"recent" count:@"10" until:@"" sinceID:@"" maxID:@"" includeEntities:@(0) callback:@"" successBlock:^(NSDictionary *searchMetadata, NSArray *statuses) {

        NSLog(@"searchMetadata = %@", searchMetadata);
        NSLog(@"statuses = %@", statuses);
    } errorBlock:^(NSError *error) {
        NSLog(@"twitter error = %@", error);

    }];

It's working if I put these. queryString = @"#brajobbat"; or queryString = @"@jobbadecco";

but it doesn't work if I put this. queryString = @"@jobbadecco+#brajobbat"; This will return no response.

But I got some statuses when I call this url. https://twitter.com/search?q=%40jobbadecco%20%23brajobbat

nst commented 10 years ago

I am not sure that the GET search API accepts such a format.

$ twurl "/1.1/search/tweets.json?q=@twitterapi+#Apple"
{"statuses":[],"search_metadata":{"completed_in":0.011,"max_id":519838340011397120,"max_id_str":"519838340011397120","query":"%40twitterapi%2B%23Apple","refresh_url":"?since_id=519838340011397120&q=%40twitterapi%2B%23Apple&include_entities=1","count":15,"since_id":0,"since_id_str":"0"}}

You should probably try the streaming filter API for that.

akeTML commented 10 years ago

Thanks for reply. Now I know the problem. https://dev.twitter.com/rest/public/search this link said that I can't get tweet later than one week. So, I'll try that api.