Created
July 10, 2009 19:34
-
-
Save nullstyle/144737 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# =========================== | |
# = Getting an access token = | |
# =========================== | |
require 'oauth' | |
require 'satisfaction' | |
satisfaction = Satisfaction.new | |
satisfaction.set_consumer "XXXX", "XXXXXXXXX" | |
request_token = satisfaction.request_token | |
system("open #{satisfaction.authorize_url(request_token)}") | |
puts "waiting for you to authorize the token... press return to continue" | |
gets | |
access_token = satisfaction.access_token(request_token) | |
# ========================= | |
# = Using an access token = | |
# ========================= | |
require 'oauth' | |
require 'satisfaction' | |
satisfaction = Satisfaction.new | |
satisfaction.set_consumer "XXXX", "XXXXXXXXX" | |
satisfaction.set_token "XXXX", "XXXXXXXXX" # this is the values from the access_token above | |
satisfaction.companies.post( | |
:name => "Scott's Tests Company - No Public Please", | |
:url => "http://nullstyle.com", | |
:domain => "stcnpp", | |
:website_url => "http://nullstyle.com") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment