Exemple #1
0
        public void TweetOnBehalfOf(string oauth_access_token, string oauth_token_secret, string postData)
        {
            HttpWebRequest request = PostTwits(oauth_consumer_key, oauth_consumer_secret, oauth_access_token, oauth_token_secret, postData);
            string         result  = OAuthHelper.getResponce(request);
            Dictionary <string, string> dcResult = OAuthUtility.GetQueryParameters(result);

            if (dcResult["status"] != "200")
            {
                this.oauth_error = result;
            }
        }
Exemple #2
0
        public void GetUserTaringaAccessToken(string oauth_token, string oauth_verifier)
        {
            HttpWebRequest request = FetchAccessToken(method, oauth_consumer_key, oauth_consumer_secret, oauth_token, oauth_verifier);
            string         result  = getResponce(request);

            Dictionary <string, string> resultData = OAuthUtility.GetQueryParameters(result);

            if (resultData.Keys.Contains("oauth_token"))
            {
                this.oauth_access_token        = resultData["oauth_token"];
                this.oauth_access_token_secret = resultData["oauth_token_secret"];
            }
            else
            {
                this.oauth_error = result;
            }
        }
Exemple #3
0
        public string GetRequestToken()
        {
            HttpWebRequest request = FetchRequestToken(method, oauth_consumer_key, oauth_consumer_secret);
            string         result  = getResponce(request);
            Dictionary <string, string> resultData = OAuthUtility.GetQueryParameters(result);

            if (resultData.Keys.Contains("oauth_token"))
            {
                //Guarda la cookie ots "OauthTokenSecret" Para persistir el dato que hay que enviar para el signature de taringa
                System.Web.HttpContext.Current.Response.Cookies.Remove("Ots");
                HttpCookie cookie = new HttpCookie("Ots");
                cookie.Value    = resultData["oauth_token_secret"];
                cookie.Expires  = DateTime.UtcNow.AddMinutes(30);
                cookie.HttpOnly = false;
                System.Web.HttpContext.Current.Response.Cookies.Add(cookie);

                return(resultData["oauth_token"]);
            }
            else
            {
                this.oauth_error = result;
                return("");
            }
        }