Hey everyone,
I’m excited to announce the release of the Koala 1.1 release candidate!
The big news here is support for Facebook’s batch API, which lets you bundle a number of operations into one request from Facebook:
me, friends = Koala::Facebook::GraphAPI.batch do
@api.get_object('me')
@api.get_connections('me', 'friends')
end
We’ve also added new convenience methods, improved others, and refactored the HTTP services to be more modular. All changes are, of course, fully tested and non-breaking (though if you’re interacting directly with Koala’s HTTPServices, you should review the changes).
Installation
Just run
[sudo] gem install koala --pre
or add
gem "koala", "~> 1.1.0rc"
to your Gemfile.
Changes
New methods:
- You can now make batch requests to Facebook; we support the entire API, including file uploads, error handling, and FQL.
- GraphAPI#get_comments_for_urls (pretty self-explanatory)
- RestAPI#fql_multiquery, which simplifies both making the requests and using the results
Updated methods:
- RealtimeUpdates now uses a GraphAPI object instead of its own API
- RestAPI#rest_call now has an optional last argument for method, for calls requiring POST, DELETE, etc.
- UploadableIO can take a filename (for the Ads API)
- get_objects([]) returns [] instead of a Facebook error
Internal improvements:
- HTTP services are more modular and can be changed on the fly
- Includes support for uploading StringIOs and other non-files via Net::HTTP even when using TyphoeusService
- Support for global proxy and timeout settings
- Support for setting certificate path and file to address Net::HTTP errors under Ruby 1.9.2
Thank to…
We’ve had a lot of great contributions in this release. Huge thanks to chadk for refactoring the HTTPServices, to seejohnrun for the initial implementation of the Batch API, and to amrnt and aselder, who both contributed several patches. As always, thanks also to Chris, my codeveloper, and to the people at Context Optional, who have been awesome in supporting Koala’s development.
Note: Facebook now requests access tokens for certain API requests
In case you missed this on the FB developer blog, Graph API requests for PROFILE_ID/feed and PROFILE_ID/posts now requires an access token. This is a breaking change on Facebook’s end. If you’ve started to see errors when making anonymous requests for those connections, that’s why.
What’s next
If everything goes well with the release candidate, we’ll release 1.1 mid-month. In the meanwhile, if you encounter any issues or have any questions, drop me an email or open up an issue.
Enjoy the Batch API and have a great week!
Alex
Comments
Hi,
I was trying real time updates and I can access all public information with your api. If I need to get real time updates for feeds and updates where we need to pass access_toke(user_access_token or page_access_token) . How do I go forward on this? . I checked the RealTimeUpdate class and found only two arguments app_access_token and app_id, which may not be sufficient to get the protected data like feeds and post
Here am attaching the sample code:
@updates = Koala::Facebook::RealtimeUpdates.new(:app_id => YOUR_APP_ID, :secret => YOUR_APP_SECRET )
=> #<Koala::Facebook::RealtimeUpdates:0x10331fb88 @graph_api=#, @secret=”81297xxxxxxxxxxx”, @app_access_token=”1779yyyyyyy|xxxxxxx”, @app_id=”1779yyyyy”>
and you can see app_access_token and access_token has been set the same.
Then I tried to retrieve the access token as follows but returning nil
>> @updates.access_token
=> nil
Kindly advise how do I go forward?
Regards
Shihab
Hi,
Seems the above problem is a bug in facebook. Please refer http://bugs.developers.facebook.net/show_bug.cgi?id=18048 . You may verify this
Thanks for your quick response
Regards
Shihab