charliewolf/pynder

Iterating though nearby_users() gives an error

goelakash opened this issue · 1 comments

In [27]: for user in users:
    ...:     print(user.name)
    ...:     time.sleep(5)
    ...:

Alisha

KeyError Traceback (most recent call last)
in ()
----> 1 for user in users:
2 print(user.name)
3 time.sleep(5)
4

~/miniconda3/lib/python3.6/site-packages/pynder/session.py in nearby_users(self, limit)
28 for user in users:
29 if not user["id"].startswith("tinder_rate_limited_id"):
---> 30 yield Hopeful(user, self)
31 if not len(users):
32 break

~/miniconda3/lib/python3.6/site-packages/pynder/models/user.py in init(self, data, session)
25 try:
26 self.schools.extend([school["name"] for school in data['schools']])
---> 27 self.schools_id.extend([school["id"] for school in data['schools']])
28 self.jobs.extend(["%s @ %s" % (job["title"]["name"], job["company"][
29 "name"]) for job in data['jobs'] if 'title' in job and 'company' in job])

~/miniconda3/lib/python3.6/site-packages/pynder/models/user.py in (.0)
25 try:
26 self.schools.extend([school["name"] for school in data['schools']])
---> 27 self.schools_id.extend([school["id"] for school in data['schools']])
28 self.jobs.extend(["%s @ %s" % (job["title"]["name"], job["company"][
29 "name"]) for job in data['jobs'] if 'title' in job and 'company' in job])

KeyError: 'id'

Fixed by using the code from the repo, not pip.