Permalink
Browse files

Fixed instantiation of Flickr - added author name

  • Loading branch information...
1 parent 1ada96f commit 2038ad05fa3709d3c8c93c56240118aa7b3a1ed2 @boncey boncey committed Jan 7, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 examples/web_oauth.rb
@@ -3,6 +3,8 @@
# A short howto for web flow authentication on the flickr website.
# This would live inside a rails controller or alternative framework equivalent
# Error handling left out for clarity :-)
+# Added by Darren Greaves (https://github.com/boncey/)
+#
# You need an API key first, see http://www.flickr.com/services/api/keys/
API_KEY=''
SHARED_SECRET=''
@@ -15,7 +17,7 @@
# Users should hit this method to get the link which sends them to flickr
def auth
- flickr = Flickr.new
+ flickr = FlickRaw::Flickr.new
token = flickr.get_request_token(:oauth_callback => URI.escape(@callback_url))
# You'll need to store the token somewhere for when the user is returned to the callback method
# I stick mine in memcache with their session key as the cache key
@@ -26,7 +28,7 @@ def auth
# Your users browser will be redirected here from Flickr (see @callback_url above)
def callback
- flickr = Flickr.new
+ flickr = FlickRaw::Flickr.new
token = # Retrieve from cache or session etc - see above
oauth_token = params[:oauth_token]
@@ -42,8 +44,7 @@ def callback
# Store the oauth_token and oauth_token_secret in session or database
# and attach to a Flickraw instance before calling any methods requiring authentication
- # Attach the tokens to your flickr instance
- # You can now make authenticated calls with the flickr object
+ # Attach the tokens to your flickr instance - you can now make authenticated calls with the flickr object
flickr.access_token = oauth_token
flickr.access_secret =[oauth_token_secret

0 comments on commit 2038ad0

Please sign in to comment.