diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2017-01-03 21:05:01 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2017-01-03 21:05:01 (GMT) |
commit | 8dc59f6f8a145952ceaec8f6d9ffd59d37ca058e (patch) | |
tree | b9037ec4fceb02ac9ea2e3a5d69ab7b311e81cae /htt.py | |
parent | 8d3cfbd9814c80452e2b57a6c936cd4f6eea445a (diff) |
Avoided to highlight the same content several times.
Diffstat (limited to 'htt.py')
-rwxr-xr-x | htt.py | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -72,18 +72,24 @@ class StdOutListener(StreamListener): if like: - try: + if self._memory.is_original_content(content): - self._api.create_favorite(sid) + try: - self._memory.save_liked_status(sid, username) + self._api.create_favorite(sid) - print('@%s: "%s" (id=%d)' % (username, content, sid)) - print(' -> https://twitter.com/%s/status/%d' % (username, sid)) + self._memory.save_liked_status(sid, username, content) - except tweepy.error.TweepError: + print('@%s: "%s" (id=%d)' % (username, content, sid)) + print(' -> https://twitter.com/%s/status/%d' % (username, sid)) - pass + except tweepy.error.TweepError: + + pass + + else: + + print('Already seen "%s"' % content) else: |