Hi,
According to Twitter’s documentation I can add -filter:links in a search term to exclude links. This clearly works in the search portal of Twitter However, I would like to know if I can also include it in my python-script that uses the Streaming API. The following search output differs from the output of my Python script if I compare them
Twitter website:
https://twitter.com/search?f=tweets&q=Russia%20OR%20America%20OR%20England%20-filter%3Alinks&src=typd
Python:
search_terms = ['Russia', 'America', 'England', ' AND -filter:links']
class StdOutListener(StreamListener):
def on_data(self, data):
print(data)
return True
def on_error(self, status):
print(status)
if __name__ == "__main__":
listener = StdOutListener()
auth = OAuthHandler(USER_KEY, USER_SECRET)
auth.set_access_token(ACCESS_TOKEN, ACCESS_SECRET)
stream = Stream(auth, listener)
stream.filter(languages=['en'], track=search_terms)
I would like the stream.filter function to do the following
stream.filter(languages=['en'], track= Russia OR America OR England AND -filter:links