Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scraper.py is Pulling retweets also #7

Open
GloriaHristova opened this issue Jul 22, 2018 · 0 comments
Open

scraper.py is Pulling retweets also #7

GloriaHristova opened this issue Jul 22, 2018 · 0 comments

Comments

@GloriaHristova
Copy link

Consider changing the code in the part where retweets should be filtered out. According to Twitter documentation the object 'retweeted_status' is presented only when the tweet is a 'retweet' - https://developer.twitter.com/en/docs/tweets/data-dictionary/overview/intro-to-tweet-json .

The "retweeted" object that you use in your scraper.py script does not exclude retweets (as long as I correctly understood the logic of your script - you want to filter them out in the beginning of the script). The "retweeted" object" indicates whether this Tweet has been Retweeted by the authenticating user" - https://developer.twitter.com/en/docs/tweets/data-dictionary/overview/tweet-object .

To remove retweets you can simply check whether the 'status' argument in on_status() method has the 'retweeted_status' attribute.

I have ran the script and currently the output contains retweets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant