Skip to content

How to I stream language tweets? #1193

Answered by Harmon758
raomanohar asked this question in Questions
Discussion options

You must be logged in to vote

There's syntactical mistakes with how you're passing the keyword argument, but the name of the kwarg for Stream.filter is languages anyway:

tweepy/tweepy/streaming.py

Lines 432 to 433 in cc3c8e7

def filter(self, follow=None, track=None, is_async=False, locations=None,
stall_warnings=False, languages=None, encoding='utf8', filter_level=None):
It accepts a list of languages, so you would provide it like so: stream.filter(languages=["pt"]).
However, note, you'll still need to input either a list of user IDs to follow, using follow; a list of keywords to track, using track; or a list of locations to track, using locations.
See https://developer.twitter.com/en/docs/tweets…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Harmon758
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question This is a question API This is regarding Twitter's API Discussion This was converted/moved from/to a discussion
2 participants
Converted from issue

This discussion was converted from issue #1193 on December 18, 2020 07:16.