当前位置: 首页>>代码示例>>C#>>正文


C# TwitterUser.Post_Status_Update方法代码示例

本文整理汇总了C#中GlobusTwitterLib.App.Core.TwitterUser.Post_Status_Update方法的典型用法代码示例。如果您正苦于以下问题:C# TwitterUser.Post_Status_Update方法的具体用法?C# TwitterUser.Post_Status_Update怎么用?C# TwitterUser.Post_Status_Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GlobusTwitterLib.App.Core.TwitterUser的用法示例。


在下文中一共展示了TwitterUser.Post_Status_Update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PostScheduleMessage

        public override void PostScheduleMessage(dynamic data)
        {
            try
            {

                oAuthTwitter OAuthTwt = new oAuthTwitter();
                TwitterAccountRepository fbaccrepo = new TwitterAccountRepository();
                TwitterAccount twtaccount = fbaccrepo.getUserInformation(data.UserId, data.ProfileId);


                OAuthTwt.CallBackUrl = System.Configuration.ConfigurationSettings.AppSettings["callbackurl"];
                OAuthTwt.ConsumerKey = System.Configuration.ConfigurationSettings.AppSettings["consumerKey"];
                OAuthTwt.ConsumerKeySecret = System.Configuration.ConfigurationSettings.AppSettings["consumerSecret"];
                OAuthTwt.AccessToken = twtaccount.OAuthToken;
                OAuthTwt.AccessTokenSecret = twtaccount.OAuthSecret;
                OAuthTwt.TwitterScreenName = twtaccount.TwitterScreenName;
                OAuthTwt.TwitterUserId = twtaccount.TwitterUserId;


                #region For Testing
                // For Testing 

                //OAuthTwt.ConsumerKey = "udiFfPxtCcwXWl05wTgx6w";
                //OAuthTwt.ConsumerKeySecret = "jutnq6N32Rb7cgbDSgfsrUVgRQKMbUB34yuvAfCqTI";
                //OAuthTwt.AccessToken = "1904022338-Ao9chvPouIU8ejE1HMG4yJsP3hOgEoXJoNRYUF7";
                //OAuthTwt.AccessTokenSecret = "Wj93a8csVFfaFS1MnHjbmbPD3V6DJbhEIf4lgSAefORZ5";
                //OAuthTwt.TwitterScreenName = "";
                //OAuthTwt.TwitterUserId = ""; 
                #endregion

                TwitterUser twtuser = new TwitterUser();

                if (string.IsNullOrEmpty(data.ShareMessage))
                {
                    data.ShareMessage = "There is no data in Share Message !";
                }

                JArray post = twtuser.Post_Status_Update(OAuthTwt, data.ShareMessage);

                
             
                Console.WriteLine("Message post on twitter for Id :" + twtaccount.TwitterUserId + " and Message: " + data.ShareMessage);
                ScheduledMessageRepository schrepo = new ScheduledMessageRepository();
                schrepo.updateMessage(data.Id);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                Log log = new Log();
                log.CreatedDate = DateTime.Now;
                log.Exception = ex.Message;
                log.Id = Guid.NewGuid();
                log.ModuleName = "TwitterScheduler";
                log.ProfileId = data.ProfileId;
                log.Status = false;
                LogRepository logRepo = new LogRepository();
                logRepo.AddLog(log);
            }

        }
开发者ID:JBNavadiya,项目名称:socioboard,代码行数:60,代码来源:TwitterScheduler.cs

示例2: PostScheduleMessage

        public override void PostScheduleMessage(dynamic data)
        {
            try
            {

                oAuthTwitter OAuthTwt = new oAuthTwitter();
                TwitterAccountRepository fbaccrepo = new TwitterAccountRepository();
                TwitterAccount twtaccount = fbaccrepo.getUserInformation(data.UserId, data.ProfileId);
                OAuthTwt.CallBackUrl = System.Configuration.ConfigurationSettings.AppSettings["callbackurl"];
                OAuthTwt.ConsumerKey = System.Configuration.ConfigurationSettings.AppSettings["consumerKey"];
                OAuthTwt.ConsumerKeySecret= System.Configuration.ConfigurationSettings.AppSettings["consumerSecret"];
                OAuthTwt.AccessToken = twtaccount.OAuthToken;
                OAuthTwt.AccessTokenSecret= twtaccount.OAuthSecret;
                OAuthTwt.TwitterScreenName = twtaccount.TwitterScreenName;
                TwitterUser twtuser = new TwitterUser();
                JArray post = twtuser.Post_Status_Update(OAuthTwt, data.ShareMessage);

                Console.WriteLine("Message post on twitter for Id :" + twtaccount.TwitterUserId + " and Message: " + data.ShareMessage);
                ScheduledMessageRepository schrepo = new ScheduledMessageRepository();
                schrepo.updateMessage(data.Id);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
            }
        }
开发者ID:utkarshx,项目名称:socioboard,代码行数:26,代码来源:TwitterScheduler.cs

示例3: ProcessRequest


//.........这里部分代码省略.........

                    foreach (var item in userid)
                    {
                        string[] networkingwithid = item.Split('_');
                        if (networkingwithid[0] == "fb")
                        {
                            FacebookAccountRepository fbaccountrepo = new FacebookAccountRepository();
                            FacebookAccount fbaccount = fbaccountrepo.getFacebookAccountDetailsById(networkingwithid[1], user.Id);
                            var args = new Dictionary<string, object>();
                            args["message"] = message;
                            FacebookClient fc = new FacebookClient(fbaccount.AccessToken);
                            var facebookpost = fc.Post("/me/feed", args);
                            if (facebookpost.ToString() != string.Empty)
                            {
                                Response.Write("Succesfully posted");
                            }
                            else
                            {
                                Response.Write("Not posted");
                            }

                        }
                        else if (networkingwithid[0] == "twt")
                        {
                            TwitterAccountRepository twtaccountrepo = new TwitterAccountRepository();
                            TwitterAccount twtaccount = twtaccountrepo.getUserInformation(user.Id, networkingwithid[1]);
                            oAuthTwitter OAuthTwt = new oAuthTwitter();
                            TwitterHelper twthelper = new TwitterHelper();
                            OAuthTwt.AccessToken = twtaccount.OAuthToken;
                            OAuthTwt.AccessTokenSecret = twtaccount.OAuthSecret;
                            OAuthTwt.TwitterScreenName = twtaccount.TwitterScreenName;
                            twthelper.SetCofigDetailsForTwitter(OAuthTwt);
                            TwitterUser twtuser = new TwitterUser();
                            JArray post = twtuser.Post_Status_Update(OAuthTwt, message);
                            if (post.ToString() != string.Empty)
                            {
                                Response.Write("Succesfully posted");
                            }
                            else
                            {
                                Response.Write("Not posted");
                            }
                        }
                        else if (networkingwithid[0] == "lin")
                        {
                            LinkedInAccountRepository linkedinaccrepo = new LinkedInAccountRepository();
                            LinkedInAccount linkedaccount = linkedinaccrepo.getUserInformation(user.Id, networkingwithid[1]);
                            oAuthLinkedIn Linkedin_oauth = new oAuthLinkedIn();

                            Linkedin_oauth.Verifier = linkedaccount.OAuthVerifier;
                            Linkedin_oauth.TokenSecret = linkedaccount.OAuthSecret;
                            Linkedin_oauth.Token = linkedaccount.OAuthToken;
                            Linkedin_oauth.Id = linkedaccount.LinkedinUserId;
                            Linkedin_oauth.FirstName = linkedaccount.LinkedinUserName;
                            SocialStream sociostream = new SocialStream();
                            string res = sociostream.SetStatusUpdate(Linkedin_oauth, message);
                        }
                    }
                    #endregion
                }
                else if (Request.QueryString["op"] == "wooqueuemessages")
                {
                    ScheduledMessageRepository schmsgRepo = new ScheduledMessageRepository();
                    List<ScheduledMessage> lstschMsg = schmsgRepo.getAllMessagesOfUser(user.Id);
                    string schmessages = string.Empty;
                    string profurl = string.Empty;
开发者ID:utkarshx,项目名称:socioboard,代码行数:67,代码来源:AjaxHome.aspx.cs


注:本文中的GlobusTwitterLib.App.Core.TwitterUser.Post_Status_Update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。