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

Fix retrieving Author timeline #389

Merged
merged 1 commit into from
Nov 13, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions orangecontrib/text/twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ class TwitterAPI:

tv = data.TimeVariable('Date')
metas = [
(data.StringVariable('Content'), lambda doc: doc.full_text),
(data.StringVariable('Content'), lambda doc: doc.full_text if not
doc.retweeted else doc.text),
(tv, lambda doc: TwitterAPI.tv.parse(doc.created_at.isoformat())),
(data.DiscreteVariable('Language'), lambda doc: doc.lang),
(data.DiscreteVariable('Location'), lambda doc: getattr(doc.place, 'country_code', None)),
Expand Down Expand Up @@ -188,7 +189,8 @@ def search_authors(self, authors, *, max_tweets=0, collecting=False):
if not isinstance(authors, list):
authors = [authors]

cursors = [tweepy.Cursor(self.api.user_timeline, screen_name=a)
cursors = [tweepy.Cursor(self.api.user_timeline, screen_name=a,
tweet_mode='extended')
for a in authors]
corpus, count = self.fetch(cursors, max_tweets)
self.append_history('Author', authors, None, None, count)
Expand Down