How to limit the language of Twitter4j results to English?

I tried using setLang(String lang) ie; → setLang("en") and lang(String lang) ie; lang("en") of the Request class method. But they do not work.

Also, if I want to use several keywords in my search query and have to limit the results to tweets containing ALL keywords, what should I do?

0
source share
1 answer

Just using the dev console , an api call search was done like this (search for tweaks "stackoverflow" in Russian):

 https://api.twitter.com/1.1/search/tweets.json?q=stackoverflow&lang=ru 

... and everything went fine. Less likely, but this may be a bug in twitter4j. Try debugging it and see what actual api call is made. This should give you some clues.

About the second question. See the Search Operators section of this document . what you want is the default behavior, so just list your keywords with spaces in between, and this should do the trick.

+1
source

All Articles