diff options
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.""" |