Singly/hallway — pull request #853 by kristjan (2013-03-20 21:38:20+00:00)
Title: Redo Foursquare checkins synclet

Another recursive monstrosity destroyed.

The strategy here is to start at `now` on the first run and use the earliest
known checkin time with the API's `beforeTimestamp` to page backwards.
Meantime, we keep track on the side of the latest checkin we've seen. When we
hit either the end of history or a checkin we've seen before, we clear the
cursor, set the "we've seen this" time to the latest known checkin, and start
over.

Since it looks more and more like large chunks of data hose the pipeline, I
modulated page size based on whether it's the first sync or not. At first
sync, we want to move as fast as we can, so we max out Foursquare's API at
250. Later on, it's unlikely you've checked in 100 places since we last
synced, so we can drop to the smaller page size and save ourselves effort.