From b72fbac24d441382bdf0456f2027a4d4468530b7 Mon Sep 17 00:00:00 2001 From: codl Date: Wed, 27 Dec 2017 21:03:12 +0100 Subject: [PATCH] no! i forgot to also store fav/rt counts on twitter --- libforget/twitter.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libforget/twitter.py b/libforget/twitter.py index 619c57a..47cac21 100644 --- a/libforget/twitter.py +++ b/libforget/twitter.py @@ -115,6 +115,10 @@ def post_from_api_tweet_object(tweet, post=None): if 'entities' in tweet: post.has_media = bool( 'media' in tweet['entities'] and tweet['entities']['media']) + if 'favorite_count' in tweet: + post.favourites = tweet['favorite_count'] + if 'retweet_count' in tweet: + post.reblogs = tweet['retweet_count'] return post