vendredi 17 juillet 2020

Exclude multi-word keywords from Twitter Search API

I have a list of keywords to be excluded from search here

KEYWORDS = %w[
    covid corona subway railway travel plane brazil ]

exclude = Twitter::KEYWORDS.split(",").join(" -")

and this is how my search query looks like

 json_response = @client.search("(javascript) -#{exclude}", lang: "en", result_type: "recent", tweet_mode: "extended", count: 100)

How can I pass multi-word keywords here to be excluded, for example keywords like "off the hand" or "game plan"?

Adding them along with the other keywords doesn't work as expected.

Aucun commentaire:

Enregistrer un commentaire