Hey everyone,
We’re very excited to announce the beta release of Koala 1.0! This is a huge release, well deserving of the version bump. With this update, we’ve expanded Koala to support the entire current Facebook platform and have made improvements throughout the library to make Koala faster, easier, and more stable.
Photo Uploads
You read that right — Koala now supports photo uploads! We’ve integrated Nick Sieger’s multipart-post gem to provide support through Net::HTTP. Koala’s Graph API now offers a #put_picture method as well as support for posting file to Facebook through any Graph or REST API method.
# put_picture requires a hash containing info about the photo to upload
file_hash = {
"path" => 'path/to/some-image-file.jpg',
"content_type" => 'image/jpeg'
}
@graph.put_picture(file_hash, :message => "I've uploaded a photo!")
# => { "id" => FACEBOOK_UID_FOR_THE_PHOTO }
You can learn more about photo uploads here on the Uploading Photos wiki page.
Photos are in beta
During this beta period, we’ll be working hard to make photo uploads as simple as the rest of Koala. By the time we officially launch 1.0, you’ll be able to easily upload photos using File objects, temporary uploads to Rails or Sinatra, or from any other source using the same hash system we have now. We’ll also incorporate native support for Typhoeus file uploads as soon as that’s released (huge thanks to our friend JT Archie for implementing that feature).
Other Enhancements
API Methods:
- GraphAPI#delete_like: self-explanatory and useful. (Thanks, waseem!)
- OAuth#parse_signed_request: updated to support Facebook’s current canvas encryption plans.
Internal improvements:
- For public requests (e.g. no access token), Koala now uses http instead of https to improve speed; this can be overridden globally or per request.
- Read-only REST API requests now go through Facebook’s faster api-read server.
- For consistency, GraphAPI#delete_object will now raise an error if there’s no access token (like #put_object and #delete_like).
Test Suite improvements:
- We’ve expanded the tests for the HTTP service modules.
- Live tests now verify that the access token has the necessary permissions before starting.
- We’ve replaced the 50-person network test, which often took 15+ minutes to run live, with a much faster 5-person test.
Installing 1.0.0.beta
Installing the beta is simple — just run
sudo gem install koala --pre
Download the new version and give it a go. If you hit any problems with photo uploads, the under-the-hood improvements, or anything else, please open a ticket on Github and we’ll get it fixed. As always, too, if you have any questions/comments/feedback, just drop us an email.
Happy coding!
The Koala Team
(Alex, Chris, Rafi, and the folks at Context Optional)