I currently have a script running on my server using basic
authentication and tweeting rss feeds to a number of different
accounts.
I want to do something similar to that but using OAuth (seeing as I
cant register an application for basic auth anymore). But I'm lost,
OAuth requires a browser to work doesn't it? but my script wont be run
from a browser.
Do I have to make an authorize page and load that in a web browser to
get the access tokens and then put them into my script?
Will they ever expire?
Is there a way to automatically get the access tokens without
me making a web page that will ask me to login to twitter and
authenticate?
In answer to your question “Is there a way to automatically get the access tokens without
me making a web page that will ask me to login to
twitter and
authenticate?”, I requested this as an enhancement. Here’s the URL to the request:
http://code.google.com/p/twitter-api/issues/detail?id=1011
Al3x replied that they are working on something to help us out here, but no ETA promised.
You may want to visit the issue and star it to give it a little more weight.
Thanks,
Jim Renkel
To get the access token you just need to fetch an request token,
authorize it, and then exchange
it for an access token. There is not a way to automate the
authorization step. You can check out this
python script [1] which queries for your consumer key/secret then
opens the authorization link in the browser.
At the end you get your access token. Note: it depends on this [2] library.
Where you go next depends on which library / language you go with.
Best of luck,
Josh
[1] http://www.pastie.org/634526
[2] http://github.com/joshthecoder/tweepy