user2912166
user2912166

Reputation: 33

Twython: Filtering more than one track.

I am trying to download all tweets within some co-ordinate.

Code used:

stream.statuses.filter(track='Football',locations='22,70,24,74')

How can I pass more than one track such that It will download all tweets which contains one more tracks?

For example: 'Football' or 'game' or 'sport'.

Upvotes: 3

Views: 1628

Answers (1)

aIKid
aIKid

Reputation: 28302

From the Twitter API, seems like you can achieve this quite easily.

You can separate it by spaces, to obtain tweets with both tracks:

stream.statuses.filter(track='Football game',locations='22,70,24,74')

Or by commas, to obtain tweets with either track:

stream.statuses.filter(track='Football, game',locations='22,70,24,74')

I think twython only passes the values of track, so this should work fine.

Hope this helps!

Upvotes: 2

Related Questions