Ejemplo n.º 1
0
        private void getPinAndSearch()
        {
            var pin = getPIN();

            //webBrowser1.Visible = false;
            //webBrowser1.Dispose();

            _oauth.AcquireAccessToken(URL_ACCESS_TOKEN, "POST", pin);

            // Now you have access tokens, and you can use them in signed HTTP requests. Like this:
            // var authzHeader = oauth.GenerateAuthzHeader(url, "POST");
            // ...where url is the resource endpoint.
            // To update the user's status, it would be "http://api.twitter.com/1/statuses/update.xml?status=Hello".
            // Then set that string into the HTTP Header named Authorization.

            // To interact with third-party services, like TwitPic, you need to construct a slightly different OAuth header, like this:
            // var authzHeader = oauth.GenerateCredsHeader(URL_VERIFY_CREDS, "GET", AUTHENTICATION_REALM);
            // For Twitter, the values for the verify creds url and realm are "https://api.twitter.com/1/account/verify_credentials.json"
            // and "http://api.twitter.com/" respectively.
            // ...and put that authorization string in an HTTP header called X-Verify-Credentials-Authorization.
            // Then send that to your service, like TwitPic, along with whatever request you're sending.

            // That's it.

            Search.UpdateStatus(_oauth, "Hello");
            //Search.PerformSearch(_oauth, "#hatman");
        }