Skip to content

Add tracking of mentions to tweets#98

Open
AcesoUnderGlass wants to merge 1 commit into
taspinar:masterfrom
AcesoUnderGlass:master
Open

Add tracking of mentions to tweets#98
AcesoUnderGlass wants to merge 1 commit into
taspinar:masterfrom
AcesoUnderGlass:master

Conversation

@AcesoUnderGlass

Copy link
Copy Markdown

This includes @s and reply-tos.

@taspinar

taspinar commented Mar 6, 2018

Copy link
Copy Markdown
Owner

I think this PR duplicates the solution proposed in this comment #100 (comment)

Comment thread twitterscraper/tweet.py

@classmethod
def from_soup(cls, tweet):
mentions = []

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks a bit cumbersome.
Would it work if you implemented mentions = tweet.find('div', 'tweet')['data-mentions'] or "" on line 47, and subsequently self.mentions = mentions.split() on line 20.
In this case, if the passed argument is an empty string, the applied split() operation will results in an empty list.

Comment thread twitterscraper/tweet.py
self.retweets = retweets
self.likes = likes
self.html = html
self.mentions = mentions

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are never passing the contents of 'mentions' in the from_soup method to this class. (see line 9)

@taspinar taspinar left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments.

@lapp0 lapp0 added the stale label Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants