Created
May 12, 2010 20:47
-
-
Save superfeedr/399103 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
require 'rubygems' | |
require 'sinatra' | |
# Accepts subscriptions vcerification and unsubscription verification | |
get '/ok' do | |
params['hub.challenge'] | |
end | |
# Refuses subscriptions vcerification and unsubscription verification | |
get '/ko' do | |
params['hub.challenge'] + "ko" | |
end | |
post '/ok' do | |
puts params.inspect | |
puts request.inspect | |
puts request.body.read | |
end | |
# Accepts subscriptions vcerification but refuses unsubscription verification | |
get '/okko' do | |
if params['hub.mode'] == "subscribe" | |
params['hub.challenge'] | |
else | |
"somethingunrelated" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment