Created
September 15, 2011 12:14
-
-
Save penso/1219088 to your computer and use it in GitHub Desktop.
Delivering Push Notifications with OAuth
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
# Read http://developer.4push.com/ | |
require 'rubygems' | |
require 'oauth' | |
# Change those | |
consumer_key = "wJlvuDeAVCIO8Bb8ABRN" | |
consumer_secret = "fwVw4n1jdG4Rox25QPC3BXmYlABrO7brOsDpzgBe" | |
### | |
site = "http://www.appnotifications.com" | |
@consumer=OAuth::Consumer.new consumer_key, consumer_secret, {:site=>site} | |
@request_token=@consumer.get_request_token(:oauth_callback => "http://localhost/") | |
# Visit this and approve | |
@request_token.authorize_url | |
# Use the oauth_verifier you got from the authorize_url once approved | |
@access_token = @request_token.get_access_token(:oauth_verifier => "tjyhCPEXOCAORlDiocVk") | |
@access_token.get "/account/notifications.json" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment