Hi Miles,

If you register your application as a Desktop app with Twitter it will use the new PIN-based flow. The idea would be that a user will have to go to twitter.com the first time and approve your emacs plugin. When they approve it they will be presented with a PIN they then type back into your plugin. When the PIN is re-entered you can request an access token that you save and the user can use that from then on. For an example of a command line app that uses the flow check out the "oauth" command installed by the OAuth gem [1]. It pretty much outputs a URL and says "go here" followed by a prompt for the PIN.

Thanks;
 – Matt Sanford / @mzsanford
     Twitter Dev

[1] - http://github.com/mojodna/oauth/tree/mergeable

On Jun 29, 2009, at 1:06 PM, Miles wrote:


Hello,

I'm writing up a small Twitter client that runs inside of Emacs. I
know there's already Twit.el, but I've been wanting to learn how to
customize Emacs and it's been a fun project. I am mostly done and in
the course of trying to set the "source" attribute on posts
originating from my client, I realized that the Twitter API wants me
to use OAuth.

Right now I'm communicating with Twitter over HTTPS, there's no
security issue there. Still, I'm looking through the OAuth
documentation and it seems to be very slanted towards a GUI
environment. Is there any sample code out there that demonstrates
using OAuth that doesn't involve these web-page redirects?

I'm using Curl to communicate with Twitter right now (as recommended
by the API documentation). Any code that demonstrates using OAuth with
Curl would be awesome. I started poking around but I'm starting to get
the impression that this just isn't something that will work.

Thank you,
-- Miles

Reply via email to