Specifically, here's what I tried, but it doesn't seem to quite fly -
before do
next if request.path_info =~ /ping$/
@user = 'kennedypj' # @user = session[:user]
@client = TwitterOAuth::Client.new(
:consumer_key => @@config['consumer_key'],
:consumer_secret => @@config['consumer_secret'],
:token => @@config['token'],
:secret => @@config['secret']
)
end
On Tue, Feb 1, 2011 at 6:12 PM, Patrick <[email protected]> wrote:
> I'm somewhat burnt out on PHP development, and want to get into Ruby.
> The twitter_oauth gem by @moomerman looks great.
>
> He says: "Now if you keep hold of the access_token (usually in the
> database) for this user you won’t need to re-authorize them next time.
> When you create an instance of the client you can just pass in the
> access token and secret that you have stored."
>
> Then he specifies this in the code -
>
> "access_token = @user.access_token # assuming @user"
>
> But this is somewhat opaque to me, given the documentation. How do I
> create @user such that I can initialize Client.new( ) properly? I
> have the component parts of an access token, of course.
>
> If I can do this without the authorization steps, then I can develop
> locally without having to deal with the callback, which makes
> development feasible. Does a rubyist have a simple snippet of how to
> login via twitter_oauth without authorization URL?
>
> ~Patrick
>
> --
> Twitter developer documentation and resources: http://dev.twitter.com/doc
> API updates via Twitter: http://twitter.com/twitterapi
> Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
> Change your membership to this group:
> http://groups.google.com/group/twitter-development-talk
>
--
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group:
http://groups.google.com/group/twitter-development-talk