lp:~robru/gwibber/twitter

Created by Robert Bruce Park and last modified
Get this branch:
bzr branch lp:~robru/gwibber/twitter
Only Robert Bruce Park can upload to this branch. If you are Robert Bruce Park please log in for upload directions.

Branch merges

Related bugs

Related blueprints

Branch information

Owner:
Robert Bruce Park
Project:
Gwibber
Status:
Merged

Recent revisions

1493. By Robert Bruce Park

Add tests for the rate limiter.

1492. By Robert Bruce Park

Catch 403s in send_private, with test.

1491. By Robert Bruce Park

Fill out some comments and docstrings.

1490. By Robert Bruce Park

Prevent duplicate message ids from filling up the message_ids column.

It turns out that it's quite easy to see the same message multiple
times, and previously the dupe-checking logic was successful in
stopping the message from being published more than once, it blindly
appended the message_id to the list regardless of whether or not it
was already on the list, so that tended to fill up with junk quick.

With test case.

1489. By Robert Bruce Park

Implement a basic rate limiter.

This had to be done in the Downloader class unfortunately because it
needed direct access to the HTTP headers and I didn't really see any
way to access those outside of the Downloader class.

Luckily it will harmlessly ignore any protocol that doesn't specify
rate limits in the HTTP headers, so it should work well for Twitter
and do nothing for anybody else.

This basically makes no attempt to limit you if you have more than 5
requests remaining in the rate limit window (making it unobtrusive for
cases where the dispatcher is just calling every 5 minutes and it
really should never come near the rate limiter *anyway*), but if
something has gone on such as a user requesting too many manual
refreshes, then it will forcibly pause each request long enough to
avoid hitting Twitter's rate limiter.

1488. By Robert Bruce Park

Undo a change that wasn't necessary.

1487. By Robert Bruce Park

Added comment as per barry.

1486. By Robert Bruce Park

Cleanup some API formatting.

1485. By Robert Bruce Park

Typo.

1484. By Robert Bruce Park

Fix up Base._unpublish: Better tests, bugs fixed.

Particularly I've fixed the removal of ids when there were duplicates
before, and also I've eliminated the possibility of collisions between
message id's from different services (there used to be a small chance
that twitter and facebook could assign the same message id to
different messages, and then _unpublish would get confused.

And of course, improved test coverage to prove that this is all good
now ;-)

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
Stacked on:
lp:gwibber
This branch contains Public information 
Everyone can see this information.