-
Notifications
You must be signed in to change notification settings - Fork 575
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
base: master
Are you sure you want to change the base?
Conversation
I think this PR duplicates the solution proposed in this comment #100 (comment) |
|
||
@classmethod | ||
def from_soup(cls, tweet): | ||
mentions = [] |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments.
This includes @s and reply-tos.