protected void btnAuthorize_Click(object sender, EventArgs e) { if (!TwitterConnect.IsAuthorized) { TwitterConnect twitter = new TwitterConnect(); twitter.Authorize(Request.Url.AbsoluteUri.Split('?')[0]); } }
public static void Authorize() { HttpRequest Request = HttpContext.Current.Request; if (Request != null) { TwitterConnect.API_Key = ApiSettings.Default.TwitterConsumerKey; TwitterConnect.API_Secret = ApiSettings.Default.TwitterConsumerSecret; if (!TwitterConnect.IsAuthorized) { TwitterConnect twitter = new TwitterConnect(); twitter.Authorize(SocialRedirectUrl.GetRedirectUrl(SocialSignIn.TwitterRedirectQuery)); } } }
protected void Page_Load(object sender, EventArgs e) { TwitterConnect.API_Key = Ortak.Twitter_API_Key.ToString(); TwitterConnect.API_Secret = Ortak.Twitter_API_Secret.ToString(); if (!IsPostBack) { if (!TwitterConnect.IsAuthorized) { TwitterConnect twitter = new TwitterConnect(); twitter.Authorize(Request.Url.AbsoluteUri.Split('?')[0]); } else { TwitterConnect twitter = new TwitterConnect(); DataTable dt = twitter.FetchProfile(); string AdiSoyadi = dt.Rows[0]["name"].ToString(); AdiSoyadi = Trkarakter(AdiSoyadi); Gel_Twitto = cls_Uyeler.KontrolEtUyemi_Twitter(dt.Rows[0]["screen_name"].ToString(), dt.Rows[0]["id"].ToString()); if (Gel_Twitto > 0) { string[] GelBilgi = { Gel_Twitto.ToString(), AdiSoyadi }; Veritabani_Uyenin_Sepeti_Gel(Gel_Twitto.ToString()); Session.Add("E_ticaretim", GelBilgi); Response.Redirect("Hesabim.aspx"); } else { Gel_Twitto = cls_Uyeler.Kullanici_KayitEkle_Twitter(dt.Rows[0]["screen_name"].ToString(), dt.Rows[0]["id"].ToString(), AdiSoyadi); if (Gel_Twitto > 0) { //string AdiSoyadi = dt.Rows[0]["name"].ToString(); //AdiSoyadi = Trkarakter(AdiSoyadi); string[] GelBilgi = { Gel_Twitto.ToString(), AdiSoyadi }; Veritabani_Uyenin_Sepeti_Gel(Gel_Twitto.ToString()); Session.Add("E_ticaretim", GelBilgi); Response.Redirect("Hesabim.aspx"); } else { Response.Redirect("Hata.aspx", false); } } } if (TwitterConnect.IsDenied) { ClientScript.RegisterStartupScript(this.GetType(), "key", "alert('User has denied access.')", true); } } }
/// <summary> /// Twitts passed message to Twitter. /// </summary> /// <param name="message">Text message that needs to be twitted.</param> private void TwittResults(string message) { TwitterConnect twitter = new TwitterConnect(); if (!TwitterConnect.IsAuthorized) { twitter.OAuthToken = "352481636-LLfi8s5UgTG3wgNaTAAM4PWhebHMZYZJv1pk5XIB"; twitter.OAuthTokenSecret = "cXK4IQn1YrJ2JUG4WXq9AaO74f888Nm2OIWfjORo"; twitter.Authorize(Request.Url.AbsoluteUri.Split('?')[0]); } // Post results to Twitter. Only 140 characters can be posted to Twitter: string twitt = message.Substring(0, 140); twitter.Tweet(twitt); }
/// <summary> /// Twitts passed message to Twitter. /// </summary> /// <param name="message">Text message that needs to be twitted.</param> private void TwittResults(string message) { TwitterConnect twitter = new TwitterConnect(); if (!TwitterConnect.IsAuthorized) { twitter.OAuthToken = "352481636-LLfi8s5UgTG3wgNaTAAM4PWhebHMZYZJv1pk5XIB"; twitter.OAuthTokenSecret = "cXK4IQn1YrJ2JUG4WXq9AaO74f888Nm2OIWfjORo"; twitter.Authorize(Request.Url.AbsoluteUri.Split('?')[0]); } // Post results to Twitter. Only 140 characters can be posted to Twitter: string twitt = message.Substring(0,140); twitter.Tweet(twitt); }
protected void lnk_twitter_Click(object sender, EventArgs e) { try { Session["USERINFO"] = null; Session.Clear(); TwitterConnect twitter = new TwitterConnect(); twitter.Authorize(Request.Url.AbsoluteUri.Split('?')[0]); //OAuthHelper oauthhelper = new OAuthHelper(); //string requestToken = oauthhelper.GetRequestToken(); //if (string.IsNullOrEmpty(oauthhelper.oauth_error)) // Response.Redirect(oauthhelper.GetAuthorizeUrl(requestToken)); //else // Response.Write(oauthhelper.oauth_error); } catch(Exception ex) { } }
protected void Page_Load(object sender, EventArgs e) { TwitterConnect.API_Key = "0RPrNf5mlj93eFAyTuc4yA"; TwitterConnect.API_Secret = "jDD3SEcbgR0pylPKOlh18Rx2sjicmp52mEpyvpARTus"; if (!TwitterConnect.IsAuthorized) { TwitterConnect twitter = new TwitterConnect(); twitter.Authorize(Request.Url.AbsoluteUri.Split('?')[0]); } }