Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Final touches for 0.9 -- readme, version bump, gemspec.

  • Loading branch information...
commit bc818a0d094a9685f7cadd269b079ba39184d9b4 1 parent 26c3342
@arsduo arsduo authored
Showing with 32 additions and 9 deletions.
  1. +2 −0  CHANGELOG
  2. +15 −0 Manifest
  3. +1 −1  Rakefile
  4. +2 −2 koala.gemspec
  5. +12 −6 readme.md
View
2  CHANGELOG
@@ -2,9 +2,11 @@ v0.9.0
-- Added parse_signed_request to handle Facebook's new authentication scheme
-- note: creates dependency on OpenSSL (OpenSSL::HMAC) for decryption
-- Added GraphCollection class to provide paging support for GraphAPI get_connections and search methods (thanks to jagthedrummer)
+-- Added get_page method to easily fetch pages of results from GraphCollections
-- Exchanging sessions for tokens now works properly when provided invalid/expired session keys
-- You can now include a :typhoeus_options key in TyphoeusService#make_request's options hash to control the Typhoeus call (for example, to set :disable_ssl_peer_verification => true)
-- All paths provided to HTTP services start with leading / to improve compatibility with stubbing libraries
+-- If Facebook returns nil for search or get_connections requests, Koala now returns nil rather than throwing an exception
v0.8.0
-- Breaking interface changes
View
15 Manifest
@@ -2,6 +2,20 @@ CHANGELOG
LICENSE
Manifest
Rakefile
+examples/oauth_playground/Capfile
+examples/oauth_playground/LICENSE
+examples/oauth_playground/Rakefile
+examples/oauth_playground/config.ru
+examples/oauth_playground/config/deploy.rb
+examples/oauth_playground/config/facebook.yml
+examples/oauth_playground/lib/load_facebook.rb
+examples/oauth_playground/lib/oauth_playground.rb
+examples/oauth_playground/readme.md
+examples/oauth_playground/spec/oauth_playground_spec.rb
+examples/oauth_playground/spec/spec_helper.rb
+examples/oauth_playground/tmp/restart.txt
+examples/oauth_playground/views/index.erb
+examples/oauth_playground/views/layout.erb
init.rb
koala.gemspec
lib/koala.rb
@@ -16,6 +30,7 @@ spec/koala/graph_and_rest_api/graph_and_rest_api_no_token_tests.rb
spec/koala/graph_and_rest_api/graph_and_rest_api_with_token_tests.rb
spec/koala/graph_api/graph_api_no_access_token_tests.rb
spec/koala/graph_api/graph_api_with_access_token_tests.rb
+spec/koala/graph_api/graph_collection_tests.rb
spec/koala/live_testing_data_helper.rb
spec/koala/net_http_service_tests.rb
spec/koala/oauth/oauth_tests.rb
View
2  Rakefile
@@ -4,7 +4,7 @@ require 'rake'
require 'echoe'
# gem management
-Echoe.new('koala', '0.8.0') do |p|
+Echoe.new('koala', '0.9.0') do |p|
p.summary = "A lightweight, flexible library for Facebook with support for the Graph API, the old REST API, realtime updates, and OAuth validation."
p.description = "Koala is a lightweight, flexible Ruby SDK for Facebook. It allows read/write access to the social graph via the Graph API and the older REST API, as well as support for realtime updates and OAuth and Facebook Connect authentication. Koala is fully tested and supports Net::HTTP and Typhoeus connections out of the box and can accept custom modules for other services."
p.url = "http://github.com/arsduo/koala"
View
4 koala.gemspec
@@ -2,11 +2,11 @@
Gem::Specification.new do |s|
s.name = %q{koala}
- s.version = "0.8.0"
+ s.version = "0.9.0"
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
s.authors = ["Alex Koppel, Chris Baclig, Rafi Jacoby, Context Optional"]
- s.date = %q{2010-09-15}
+ s.date = %q{2010-09-29}
s.description = %q{Koala is a lightweight, flexible Ruby SDK for Facebook. It allows read/write access to the social graph via the Graph API and the older REST API, as well as support for realtime updates and OAuth and Facebook Connect authentication. Koala is fully tested and supports Net::HTTP and Typhoeus connections out of the box and can accept custom modules for other services.}
s.email = %q{alex@alexkoppel.com}
s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "lib/koala.rb", "lib/koala/graph_api.rb", "lib/koala/http_services.rb", "lib/koala/realtime_updates.rb", "lib/koala/rest_api.rb"]
View
18 readme.md
@@ -18,7 +18,7 @@ The Graph API is the simple, slick new interface to Facebook's data. Using it w
The response of most requests is the JSON data returned from the Facebook servers as a Hash.
-When retrieving data that returns an array of results (for example, when calling GraphAPI#get_connections or GraphAPI#search) a GraphCollection object (a sub-class of Array) will be returned, which contains added mehtods for getting the next and previous page of results:
+When retrieving data that returns an array of results (for example, when calling GraphAPI#get_connections or GraphAPI#search) a GraphCollection object (a sub-class of Array) will be returned, which contains added methods for getting the next and previous page of results:
# Returns the feed items for the currently logged-in user as a GraphCollection
feed = graph.get_connections("me", "feed")
@@ -33,12 +33,15 @@ When retrieving data that returns an array of results (for example, when calling
# Returns an array describing the URL for the next page: [path, arguments]
# This is useful for paging across multiple requests
next_path, next_args = feed.next_page_params
+
+ # You can use those params to easily get the next (or prevous) page
+ page = graph.get_page(feed.next_page_params)
Check out the wiki for more examples.
The old-school REST API
-----
-Where the Graph API and the old REST API overlap, you should choose the Graph API. Unfortunately, that overlap is far from complete, and there are many important API calls -- including fql.query -- that can't yet be done via the Graph.
+Where the Graph API and the old REST API overlap, you should choose the Graph API. Unfortunately, that overlap is far from complete, and there are many important API calls that can't yet be done via the Graph.
Koala now supports the old-school REST API using OAuth access tokens; to use this, instantiate your class using the RestAPI class:
@@ -59,16 +62,19 @@ If your application uses Koala and the Facebook [JavaScript SDK](http://github.c
@oauth.get_user_from_cookie(cookies)
And if you have to use the more complicated [redirect-based OAuth process](http://developers.facebook.com/docs/authentication/), Koala helps out there, too:
- # generate authenticating URL
- @oauth.url_for_oauth_code
- # fetch the access token once you have the code
- @oauth.get_access_token(code)
+ # generate authenticating URL
+ @oauth.url_for_oauth_code
+ # fetch the access token once you have the code
+ @oauth.get_access_token(code)
You can also get your application's own access token, which can be used without a user session for subscriptions and certain other requests:
@oauth.get_app_access_token
That's it! It's pretty simple once you get the hang of it. If you're new to OAuth, though, check out the wiki and the OAuth Playground example site (see below).
+*Signed Requests:* Excited to try out the new signed request authentication scheme? Good news! Koala now supports parsing those parameters:
+ @oauth.parse_signed_request(request)
+
*Exchanging session keys:* Stuck building tab applications on Facebook? Wishing you had an OAuth token so you could use the Graph API? You're in luck! Koala now allows you to exchange session keys for OAuth access tokens:
@oauth.get_token_from_session_key(session_key)
@oauth.get_tokens_from_session_keys(array_of_session_keys)
Please sign in to comment.
Something went wrong with that request. Please try again.