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

Add tracking of mentions to tweets #98

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AcesoUnderGlass
Copy link

This includes @s and reply-tos.

@taspinar
Copy link
Owner

taspinar commented Mar 6, 2018

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


@classmethod
def from_soup(cls, tweet):
mentions = []
Copy link
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.

@@ -17,27 +17,34 @@ def __init__(self, user, fullname, id, url, timestamp, text, replies, retweets,
self.retweets = retweets
self.likes = likes
self.html = html
self.mentions = mentions
Copy link
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)

Copy link
Owner

@taspinar taspinar left a comment

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