mosaicxm/mosaic-foursquare — pull request #3 by JoePym (2013-06-14 19:23:11+00:00)
Title: Added updates, photos, modernised api to v2, added tests, added config

@sbfaulkner one thing kinda led to another while I was doing this.

Highlights of major changes: existence of a configuration object to allow us to

Mosaic::Foursquare.configure(:oauth_token =>"token")

so we don't need to keep passing it around. I added updates and photos, and tests for the API before I started updating things.

I also noticed that the API was out of date (if you call it without that timestamp, it doesn't include the updates in the venue object), so I added the version flag. This caused the photo url objects to change; in that instead of just being a url now, it's prefix/suffix, with the size in between them, so I added a "url" method that either takes the size or returns the original uploaded image without arguments.

I also had to tweak the user.photo method (irritatingly), as instead of returning the URL of the user's profile, it returns the suffix/prefix. This is the only change to the API, but I bumped the minor instead of the patch because of it. To be clear:

user.photo # gem version 1.x

needs to change to

user.photo.url # gem version 2.x

I'm going to add a readme, but if you get around to reviewing this at some point, or want anyone else to review it, let me know.