summaryrefslogtreecommitdiff
path: root/db.py
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 /db.py
parentefb30aff3ec300d5e5947de9a51c3587f8e2a986 (diff)
Created a way to extract never extracted profiles on demand.HEADmaster
Diffstat (limited to 'db.py')
-rw-r--r--db.py23
1 files changed, 21 insertions, 2 deletions
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():