Skip to content
Permalink
Browse files

fix oauth

  • Loading branch information...
takuo committed Jul 30, 2011
1 parent cd9cf09 commit a3db1c594eb5a9ba1ee13e705dca049f641792d4
Showing with 3 additions and 3 deletions.
  1. +3 −3 dokanrock.rb
@@ -151,16 +151,16 @@ def get_access_token( consumer, user, pass )
"session[username_or_email]=#{user}",
"session[password]=#{pass}",
"submit=Allow" ].join( "&" )
u = URI::parse( "https://api.twitter.com/oauth/authorize" )
u = URI::parse( "https://api.twitter.com/oauth/authorize" )
http = http_new( u, false )
res = http.post( u.request_uri, query )
raise RuntimeError, "HTTP: #{res.code}" if res.code != "200"
pin = nil
lines = res.body.split( /\n/ )
i = 0
while i < lines.size
if lines[i] =~ /oauth_pin/
pin = lines[i+1].chomp.strip
if lines[i] =~ /<code>(\d+)/
pin = $1
break
end
i+=1;

0 comments on commit a3db1c5

Please sign in to comment.
You can’t perform that action at this time.