www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - OAuth libraries

reply "darkstalker" <slayerbeast gmail.com> writes:
Is there an OAuth library for D? I'm interested in writing 
twitter stuff, but haven't found an OAuth library (or even better 
a twitter one, but I can write that myself).
May 29 2012
parent "Adam D. Ruppe" <destructionator gmail.com> writes:
On Wednesday, 30 May 2012 at 02:18:58 UTC, darkstalker wrote:
 Is there an OAuth library for D?
I have one... but last time I tried it for twitter, it didn't work. (But it does work for LinkedIn and a few others. WTF.) http://arsdnet.net/dcode/oauth.d It needs some modules from my other page too: https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff cgi.d, sha.d, and curl.d I believe. It also uses the mhash C library. But since it is buggy (I think!) perhaps best to do it yourself anyway. Usage is something like this: auto info = curlOAuth(twitter(api_key, secret), path_url, ["token_secret" : secret]); to do a get and curlOAuth(twitter(api_key, secret), path_url, ["token_secret" : secret], "POST", "status=test"); to do a post. I'm pretty sure the requests will work, but I was having trouble with the authorization step and haven't gotten around to fixing it yet. I've had a very long to do list this last month.
May 29 2012