user3596965
user3596965

Reputation:

Twitter4j Query by location + blacklistword

This question relates to the twitter4j library

So when doing a standard search in twitter, it's possible to do say @Apples near:UK

However when creating an object Query object:

Query q = new Query("@Apples near:UK"); 

doesn't work. Could someone explain how I would get the tweets from a specific location, say the UK?

Upvotes: 0

Views: 503

Answers (1)

Terence Eden
Terence Eden

Reputation: 14304

There are two ways to do this.

If you take a look at the documentation you'll see that you can use Place IDs rather than text searches.

For your particular case, you will need to geocode your search as per the documentation.

The search operator “near” isn’t available in API, but there is a more precise way to restrict your query by a given location using the geocode parameter specified with the template “latitude,longitude,radius”, for example, “37.781157,-122.398720,1mi”.

Upvotes: 1

Related Questions