diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2017-06-19 18:12:21 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2017-06-19 18:12:21 (GMT) |
commit | 1cefbd13c36fe125d11ef4a650880ce18f84d4b0 (patch) | |
tree | d29c99201d4732131dbc45403b14f34cb4e60626 /tinder.py | |
parent | e14370ac867d8b2963706ccc7d209fe0b7ff3364 (diff) |
Displayed the amount of time to wait for before being able to like.
Diffstat (limited to 'tinder.py')
-rw-r--r-- | tinder.py | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -134,6 +134,35 @@ class TinderAPI(object): return meta_dct['rating']['likes_remaining'] + def can_like_in(self): + """Return the number of seconds before being allowed to issue likes.""" + + meta_dct = self._meta() + + if 'rate_limited_until' in meta_dct['rating']: + + now = int(time()) + + limited_until = meta_dct['rating']['rate_limited_until'] / 1000 + + diff = limited_until - now + + if diff > 0: + if diff % 60 == 0: + wait = diff / 60 + else: + wait = diff / 60 + 1 + + else: + wait = 0 + + else: + + wait = 0 + + return wait + + def get_recommendations(self, limit=10): """Get a fresh list of Tinder profiles.""" |