Hi All,
We currently have a java application running on a server (no user
interface) that publishes twitter status updates about new "special
deals" to one single twitter account. Users follow this account to
receive info about these specials.
This app currently uses basic authentication, so we'll need to update
it to use oauth. However I'm a little confused about what steps I need
to take. Advice will be appreciated.
Currently the code uses standard Java APIs to open a connection and
manually build a POST request (including basic-auth headers); this is
about 15 lines of Java code. The sole twitter account name and
password are stored in a configuration file on the server.
Questions:
(1)
Do I need to register an "application" here?
http://twitter.com/oauth_clients/new
Note that this app isn't something that users can download or directly
interact with.
(2)
Do I need to define a "connection" for the twitter account for this
app?
As I understand it, the option to allow a "connection" from the
twitter account only pops up after I have used a browser to log in
using the url generated by a getRequestToken call from my app. But my
app doesn't have a UI, and doesn't expect any users to log in via
browsers.
Is there perhaps some tool that I can paste the "consumer key" into,
and which will then do the getRequestToken + print the resulting URL
so I can then define a "connection" from the target twitter account?
(3)
Is xAuth the correct protocol to use here? There is only one
"user" (twitter account) used by this app.
(4)
Is there a good example of doing xauth followed by a simple status-
update in Java? Libraries like "twitter4j" or "signpost" seem like
overkill for this situation, given that the current basic-auth
implementation is about 15 lines of java.
Thanks,
Simon