Is it possible to find a way to track which keywords triggers which tweets?
For example (I'm using Python/tweepy):
track_items= "obama,bernie sanders,hilary"
stream = tweepy.Stream(auth, listener)
stream.filter(track=[track_items])
How do I know which tweets returned to me correspond Obama, Bernie Sanders, or Hilary?
I did a lot of research on this, and it seems non-trivial and not something Twitter API allows (I am hoping I'm wrong on this). If there's any suggestions/clever work-around to this, please let me know. Any advise will be greatly appreciated!
You are correct, the Twitter API does not tell you which term(s) matched each tweet. However, it is not too difficult to do this yourself.
Simply search the text in these tags: text
, display_url
, expanded_url
, and screen_name
.
Any of the above tags may contain any of your tracking terms.