summaryrefslogtreecommitdiff
path: root/tinder.py
diff options
context:
space:
mode:
Diffstat (limited to 'tinder.py')
-rw-r--r--tinder.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/tinder.py b/tinder.py
index 7906a12..3b9858a 100644
--- a/tinder.py
+++ b/tinder.py
@@ -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."""