Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/opt/local/bin/ruby
- # -*- encoding: utf-8 -*-
- require 'twitter'
- APP_TAKEN = [ "あぷりのとーくん", "あぷりのしーくれっと" ]
- PIN_CODE = 42
- def get_atoken(oauth)
- request_token = oauth.customer.get_request_token
- return request_token.get_acccess_token( :oauth_verifier => PIN_CODE )
- end
- oauth = Twitter::OAuth.new( *APP_TOKEN )
- atoken = get_atoken( oauth )
- user_atoken = [ "#{atoken.token}", "#{atoken.secret}" ]
- oauth.authorize_from_access( *user_token )
- # ついったーアカウントを作成します。
- account = Twitter::Base.new( get_oauth )
- # TL を取得します。
- timeline = account.friends_timeline
- account.update( "うふふ…" )
Add Comment
Please, Sign In to add comment