ivanvc-pft 0.1 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/pft/oauth.rb +6 -1
- metadata +1 -1
data/lib/pft/oauth.rb
CHANGED
@@ -26,7 +26,12 @@ module Pft
|
|
26
26
|
raise "Cannot authorize the account" if authorize.downcase == "n"
|
27
27
|
consumer = OAuth::Consumer.new(@key, @secret, {:site => 'http://twitter.com'})
|
28
28
|
request_token = consumer.get_request_token
|
29
|
-
|
29
|
+
url = request_token.authorize_url
|
30
|
+
if RUBY_PLATFORM =~ /darwin/
|
31
|
+
system "open #{url}"
|
32
|
+
elsif !system("firefox #{url}")
|
33
|
+
puts "Please point your browser to: \n\n#{url}\n\n"
|
34
|
+
end
|
30
35
|
puts "Please enter the provided PIN:"
|
31
36
|
pin = Base.input.gets.chomp
|
32
37
|
access_token = request_token.get_access_token(:oauth_verifier => pin) rescue false
|