Monday, November 08, 2010 at 12:01 AM.
system.verbs.apps.OAuth.getSignatureOld
on getSignature (adrparams, url, consumerSecret, tokenSecret="", method="GET") { <<Changes <<2/11/09; 7:50:52 PM by DW <<Created. <<http://www.hueniverse.com/hueniverse/2008/10/beginners-gui-1.html local (s = ""); for adr in adrparams { s = s + nameof (adr^) + "=" + string.urlencode (adr^) + "&"}; if sizeof (s) > 0 { s = string.delete (s, sizeof (s), 1)}; //drop the trailing ampersand s = method + "&" + string.urlencode (url) + "&" + string.urlencode (s); <<wp.newtextobject (s, @scratchpad.sigparamstring); edit (@scratchpad.sigparamstring) local (key = string.urlencode (consumerSecret) + "&" + string.urlencode (tokenSecret)); s = base64.encode (OAuth.getHmac (s, key), 255); <<clipboard.putvalue (s) <<wp.newtextobject (s, @scratchpad.sig); edit (@scratchpad.sig) return (s)}; bundle { //test code dialog.alert (getSignature (@scratchpad.requestparams, "http://term.ie/oauth/example/request_token.php", "secret"))}
This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.