How to search twitter using advanced options

http://twitter.com/search-advanced

I would like to do searches that mimic the aforementioned screen (for example, how to find all tweets that match โ€œnone of the wordsโ€, criteria, or just #hashtags criteria). Is it possible to mix-n- map some of these fields using twitter4j, at the moment I can only perform simple searches using keywords.

+4
source share
1 answer

If you fill out some advanced search page and actually do a search, it will fill the search box with the constructed query string. For example, if I configured it as follows:

  • All these words: word1 word2
  • Any of these words: word3 word4
  • None of these words: word5
  • From these accounts: user1 user2
  • Mentioned these accounts: user3

"word1 word2 word3 OR word4 -word5 from: user1 OR from: user2 @ user3"

Then you simply paste this line into your generated query.

Query query = new Query("word1 word2 word3 OR word4 -word5 from:user1 OR from:user2 @user3"); 
+3
source

Source: https://habr.com/ru/post/1384306/


All Articles