World: r3wp
[Ann-Reply] Reply to Announce group
older newer | first last |
Chris 23-Aug-2010 [2000] | Current theory is that I have to double url-encode my post params when signing. Sheesh. |
Pekr 23-Aug-2010 [2001] | R2 or R3? |
Chris 23-Aug-2010 [2002x2] | R2. |
Same principles should apply to R3 (after all, you're only adding a header to each request), but I don't know the R3 HTTP scheme that well. | |
Graham 23-Aug-2010 [2004x7] | So, you can tweet using OAuth ? |
If so, that's pretty cool | |
Chris, the current http protocol does support custom headers with get like this read URL [ header [ Cookie: "authtoken=anotherfoo" ]] | |
The 'header is an undocumented feature | |
Basic authentication is being turned off on twitter end of this month! | |
Is someone going to register Rebol/View as an application? | |
for OAuth | |
Chris 23-Aug-2010 [2011x4] | The answer is... |
Yesss!! | |
And thanks for the 'header tip - it works, and so this implementation works with the built-in HTTP scheme : ) | |
The obvious caveat is that it doesn't work over SSL, that I'm afraid is an exercise for those using /Command or Stunnel. | |
Graham 23-Aug-2010 [2015x2] | SSL is available for everyone |
with the latest View | |
Chris 23-Aug-2010 [2017] | Huh, so it is... |
Graham 23-Aug-2010 [2018] | I'm hoping my changes or a variation of them will be rolled into the built in http scheme :) |
Chris 23-Aug-2010 [2019x3] | I missed that. So... Works with SSL as well - cool! |
I switched out the URL and it still works : ) | |
Yes - need to be able to use 'put and 'delete for sure. | |
Graham 23-Aug-2010 [2022] | http://rebol.wik.is/Code_Samples/Tweet.r Need a little example like this one :) |
Chris 23-Aug-2010 [2023x3] | I know, it's a pain you can't use it without API keys... |
I may change the third argument to a filename that automatically loads and saves user info. At the moment, it asks for a block. | |
Note that if you view the tweets on Twitter itself, it links back to my page (where it says 'Client for REBOL') - http://twitter.com/rgrebol | |
Graham 23-Aug-2010 [2026x2] | So, what's missing? |
And can your oauth work be used for google ? | |
Chris 23-Aug-2010 [2028x5] | Should be somewhat compatible. There's two main parts: the header and the handshake. |
I've tried to separate as much as my code as is possible, but it may not be generic enough... | |
The header is used to sign request parameters, including the parameters of the OAuth header. | |
The handshake is a multi-step process to get a user's credentials: request a temporary token, send the user to the site, user comes back and enters a code, request a permanent token. | |
That's all there is to it : ) | |
Graham 23-Aug-2010 [2033] | Yeah ... I looked at this before and decided it was a little tricky :) |
Chris 23-Aug-2010 [2034] | A more generic implementation may be a protocol that wraps around http(s). read/custom oauth://[chris-:-api-:-twitter-:-com]/ [post a: 1 b: 2 c: 3] |
Graham 23-Aug-2010 [2035] | sounds like a good idea :) |
Chris 23-Aug-2010 [2036] | Doable, I think. Need to have a way to store user info over sessions. |
Graham 23-Aug-2010 [2037] | system/user ? |
Chris 23-Aug-2010 [2038] | I think that's fine if it's for your own purposes... |
Graham 23-Aug-2010 [2039] | as opposed to ? |
Chris 23-Aug-2010 [2040x3] | Well, even for twitter, I maintain an account for my soccer team - so I have an app key/secret and two user key/secrets. |
Then for google, you'd need an app key/secret and a user key/secret. | |
So you'd need to store by domain and user. | |
Graham 23-Aug-2010 [2043] | I see ... |
Chris 23-Aug-2010 [2044x3] | api.twitter.com [ "rgrebol" [ key/secret/other metadata ] ] docs.google.com [...] |
And... | |
api.twitter.com [key/secret] docs.google.com [key/secret] | |
AdrianS 24-Aug-2010 [2047] | get-env returns the value of an env variable, so you could concat that, system32, and the dll name |
Maxim 24-Aug-2010 [2048x2] | replace the lib loading line with this: k32-lib: load/library join to-file get-env "systemroot" %"/system32/Kernel32.dll" |
it works for me | |
older newer | first last |