Note that there are some explanatory texts on larger screens.

plurals
  1. POSetting up Twitter OAuth without 3rd party libraries
    text
    copied!<p>Continuation from <a href="https://stackoverflow.com/questions/10673158/get-twitter-public-timeline-jsonc-no-3rd-party-libraries">Get twitter public timeline, json+C#, no 3rd party libraries</a></p> <p>I'm still new to C# and oAuth so please bear with me if I fail to understand anything</p> <p>I've created a C# class named oAuthClass, and these are the variables I currently have:</p> <pre><code> static class oAuthClass { public static void run() { int oauth_timestamp = GetTimestamp(DateTime.Now); string oauth_nonce = PseudoRandomStringUsingGUID(); string oauth_consumer_key = "consumer key here"; string oauth_signature_method = "HMAC-SHA1"; string oauth_version = "1.0"; } } </code></pre> <p>I've read up on OAuth Signatures, and I chose to use HMAC-SHA1 for now, I don't know how to generate the signature, I'm also extremely confused after reading and seeing stuff like HTTP-Encodings and Base-Strings and whatnot (I've no idea what they mean at all), but my guess is to create a URL that's "Http-encoded", like spaces->"%20"?</p> <p>In summary: -What are base-strings?</p> <p>-Am I right on the spaces->%20 example?</p> <p>-HMAC-SHA1 involves a message and a key, is the consumer secret the message? Is the consumer key the key then?</p> <p>-How to create a signature through the use of the HMAC-SHA1 algorithm</p> <p>-If I do manage to create the signature, how do I pass these values to Twitter?</p> <p>I could use </p> <pre><code>http://example.com?consumer_key=asdf&amp;oauth_signature=signaturevalue&amp;etc., </code></pre> <p>but I've read and apparantly people use HTTP-Headers or something (again, I don't really know what this is)</p> <p>Thank you! Again, no 3rd party libraries allowed :(</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload