Skip to content

scraper.py is Pulling retweets also #7

@GloriaHristova

Description

@GloriaHristova

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions