a blog by @gregavola
OAuthentication: - Now you never have to share your foursquare password with When Will I Be Mayor again! This also allows for faster processing times with getting your history. However, this does force you to create an account with When Will I Be Mayor. I hate making new accounts too - however it's the only way. I'm sorry.
Pagination - Some people requested the ability to paginate through their results. Since we only display 10 results per page (due to API limits), you might want to see other checkins at later date. Now all sort options have paginate enabled so you can paginate forever!
Venue Monitoring - This is another cool features that allows your "monitor" venues within When Will I Be Mayor. Every week, we will check to see your progress on getting that Mayorship at your favorite place. We'll inform you of how many more checkins you have to go and the current mayor via email. Just click the binoculars icon at the top right hand-corner of the venue listing, and you'll be all set! You are allowed up monitor up to 5 venues at a time. It's that simple! This way you'll never forgot your mayorship challenge.
Comments 3 Comments
Thanks for your support! What your asking is very common as has been asked by a lot of people. The problem is the API structure for Foursquare doesn't allow you do that. Basically - how WWIBM works - is that we take your last checkins (250 at most), sort them, and count them by unique venue ID. During this process - the mayor count total is not available via the history call. So we have to make manual calls for each venue. That call gives us the the mayor count so we can perform our calculations. I would love to find a way to be able to sort by the "Counts to Mayorship" - but we would have to perform venue info calls on foursquare for at max 250 separate venues - which can be very time constraining.
We're looking into a way that we can make this work and be fast for the users without putting strain on Foursquare APIs.
Thanks again,
Greg
So the procedure would be:
1. Make API call to Foursquare to Get the Last Checkins.
2. Store the list in a database.
3. Make calls to each venue to determine mayor count.
4. Calculate mayor count and number of check-ins required to be mayor.
5. Store the results in the database with the venues for that person.
6. Display the results on the screen via a database call, sorting it how the user wants it sorted.
Using this setup would allow you to do it.