colonelpanic8 / okcupyd

A Library that enables programmatic interaction with okcupid.com, using okcupid.com's private okcupid JSON API and html scraping when necessary.
MIT License
110 stars 18 forks source link

Fix Issue #44 and #59, add workaround for #58 #71

Closed okuser closed 8 years ago

okuser commented 8 years ago

Adds a RateLimiter class to session.py. Also fixes a problem in the ages regexp in looking_for.py and adds a workaround for an error that can occur in looking up properties by detail, both suggested by dubiousjim.

colonelpanic8 commented 8 years ago

Hey! Thanks for doing this. Any chance you could write some tests?

okuser commented 8 years ago

I'm not sure how to write tests. I see the tests directory at the top level, but I don't know what to add there.

colonelpanic8 commented 8 years ago

Just write some code that uses the features you are adding / hits the bugs you are fixing.

In the case of okcupyd, use the use_cassette decorator from https://github.com/kevin1024/vcrpy

on your test function. This will record all outbound http requests and their responses when you run the test the first time. If you use the built in test recording functionality, it will automatically scrub your username and password from all http data.

okuser commented 8 years ago

Unfortunately I'm going to be traveling for the next couple weeks and won't have to time to write the tests (I also don't know particular profiles that trigger the problems in Issue #59 and Issue #58 ). I can try when I get back though.