Handle Posterous API rate-limit automatically #4

Merged
merged 5 commits into from Feb 20, 2012

2 participants

@benrhughes

I found out the hard way that Posterous rate-limits API calls to 1/sec. This change (although a bit naive) ensures that we don't exceed that. It should be completely backwards compatible - there's a new parameter on the constructor that turns the functionality on.

I also changed the JSON parse error handling, as r.error never seems to be set, and as a result 403s from Posterous were being swallowed.

I haven't run the rest suite as it seems to still be using the old auth method (ie not supplying an auth token).

@andzdroid andzdroid merged commit 6d48b49 into andzdroid:master Feb 20, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment