summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-06-23 09:50:03 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-06-23 09:50:03 (GMT)
commitd7e8b80dba1355bf844147229bbe29e8294911e7 (patch)
tree6712d92b932609ce47f8876ef8adb0efb829ee5c
parentefb30aff3ec300d5e5947de9a51c3587f8e2a986 (diff)
Created a way to extract never extracted profiles on demand.HEADmaster
-rw-r--r--cupinder.py2
-rw-r--r--db.py23
2 files changed, 22 insertions, 3 deletions
diff --git a/cupinder.py b/cupinder.py
index e91fc21..2db4237 100644
--- a/cupinder.py
+++ b/cupinder.py
@@ -92,7 +92,7 @@ if __name__=='__main__':
lid = LanguageIdentifier()
- profiles = db.load_new_profiles()
+ profiles = db.load_unknown_profiles()
remaining = tinder.get_remaining_likes()
diff --git a/db.py b/db.py
index d6f0aeb..ab52c18 100644
--- a/db.py
+++ b/db.py
@@ -207,7 +207,7 @@ class HumanKind(object):
return new
- def load_new_profiles(self):
+ def load_unknown_profiles(self):
"""Load all new Tinder profiles."""
new = []
@@ -215,7 +215,26 @@ class HumanKind(object):
values = (False, False, False)
cursor = self._db.cursor()
- cursor.execute('SELECT uid FROM People WHERE liked = ? AND superliked = ? AND passed = ?', values)
+ cursor.execute('SELECT uid FROM People WHERE liked = ? AND passed = ? AND superliked = ?', values)
+
+ for found in cursor.fetchall():
+
+ profile = self.load_profile(found['uid'])
+
+ new.append(profile)
+
+ return new
+
+
+ def load_new_profiles(self):
+ """Load all new Tinder profiles."""
+
+ new = []
+
+ values = (False, )
+
+ cursor = self._db.cursor()
+ cursor.execute('SELECT uid FROM People WHERE extracted = ?', values)
for found in cursor.fetchall():