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


C# TwitterUser.GetStatuses_Retweet_Of_Me方法代码示例

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


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

示例1: getUserRetweets

        public void getUserRetweets(string UserId, oAuthTwitter OAuth)
        {
            TwitterUser twtuser;
            #region Add User Retweet
            twtuser = new TwitterUser();
            try
            {
                JArray Retweet = null;
                try
                {
                    Retweet = twtuser.GetStatuses_Retweet_Of_Me(OAuth);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.StackTrace);
                    logger.Error("twtuser.GetStatuses_Retweet_Of_Me ex.StackTrace >> " + ex.StackTrace);
                    logger.Error("twtuser.GetStatuses_Retweet_Of_Me ex.Message >> " + ex.Message);
                }
                objTwitterMessage = new Domain.Socioboard.Domain.TwitterMessage();
                foreach (var item in Retweet)
                {
                    objTwitterMessage.UserId = Guid.Parse(UserId);
                    objTwitterMessage.Type = "twt_retweets";
                    objTwitterMessage.Id = Guid.NewGuid();

                    try
                    {
                        objTwitterMessage.MessageId = item["id_str"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterMessage.MessageDate = Utility.ParseTwitterTime(item["created_at"].ToString().TrimStart('"').TrimEnd('"'));
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterMessage.TwitterMsg = item["text"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }

                    try
                    {
                        objTwitterMessage.FromId = item["user"]["id_str"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }

                    try
                    {
                        objTwitterMessage.FromScreenName = item["user"]["screen_name"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }

                    try
                    {
                        objTwitterMessage.FromProfileUrl = item["user"]["profile_image_url"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }

                    try
                    {
                        objTwitterMessage.InReplyToStatusUserId = item["in_reply_to_status_id_str"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }

                    try
                    {
                        objTwitterMessage.SourceUrl = item["source"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    } try
                    {
                        objTwitterMessage.ProfileId = objTwitterAccount.TwitterUserId;
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
//.........这里部分代码省略.........
开发者ID:leaspb,项目名称:socioboard-core,代码行数:101,代码来源:Twitter.asmx.cs

示例2: getUserRetweets

        public void getUserRetweets(string UserId, oAuthTwitter OAuth)
        {
            TwitterUser twtuser;
            #region Add User Retweet
            twtuser = new TwitterUser();
            try
            {
                JArray Retweet = null;
                try
                {
                    Retweet = twtuser.GetStatuses_Retweet_Of_Me(OAuth);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.StackTrace);
                    logger.Error("twtuser.GetStatuses_Retweet_Of_Me ex.StackTrace >> " + ex.StackTrace);
                    logger.Error("twtuser.GetStatuses_Retweet_Of_Me ex.Message >> " + ex.Message);
                }
                objTwitterMessage = new Domain.Socioboard.MongoDomain.TwitterMessage();
                foreach (var item in Retweet)
                {
                    //objTwitterMessage.UserId = Guid.Parse(UserId);
                    objTwitterMessage.Type = "twt_retweets";
                    objTwitterMessage.Id = ObjectId.GenerateNewId();

                    try
                    {
                        objTwitterMessage.MessageId = item["id_str"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterMessage.MessageDate = Utility.ParseTwitterTime(item["created_at"].ToString().TrimStart('"').TrimEnd('"')).ToString("yyyy/MM/dd HH:mm:ss");
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterMessage.TwitterMsg = item["text"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }

                    try
                    {
                        objTwitterMessage.FromId = item["user"]["id_str"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }

                    try
                    {
                        objTwitterMessage.FromScreenName = item["user"]["screen_name"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }

                    try
                    {
                        objTwitterMessage.FromProfileUrl = item["user"]["profile_image_url"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }

                    try
                    {
                        objTwitterMessage.InReplyToStatusUserId = item["in_reply_to_status_id_str"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }

                    try
                    {
                        objTwitterMessage.SourceUrl = item["source"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    } try
                    {
                        objTwitterMessage.ProfileId = objTwitterAccount.TwitterUserId;
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
//.........这里部分代码省略.........
开发者ID:socioboard,项目名称:socioboard-core,代码行数:101,代码来源:Twitter.asmx.cs

示例3: getReTweetsOfUser

        public void getReTweetsOfUser(oAuthTwitter OAuth, TwitterAccount twitterAccount,Guid userid)
        {
            
          
            TwitterUser twtuser = new TwitterUser();
            JArray data = twtuser.GetStatuses_Retweet_Of_Me(OAuth);

            TwitterMessageRepository twtmsgrepo = new TwitterMessageRepository();
            TwitterMessage twtmsg = new TwitterMessage();
            foreach (var item in data)
            {
                twtmsg.UserId = userid;
                twtmsg.Type = "twt_retweets";
                twtmsg.Id = Guid.NewGuid();

                try
                {
                    twtmsg.MessageId = item["id_str"].ToString().TrimStart('"').TrimEnd('"');
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.StackTrace);
                }
                try
                {
                    twtmsg.MessageDate = SocioBoard.Helper.Extensions.ParseTwitterTime(item["created_at"].ToString().TrimStart('"').TrimEnd('"'));
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.StackTrace);
                }
                try
                {
                    twtmsg.TwitterMsg = item["text"].ToString().TrimStart('"').TrimEnd('"');
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.StackTrace);
                }

                try
                {
                    twtmsg.FromId = item["user"]["id_str"].ToString().TrimStart('"').TrimEnd('"');
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.StackTrace);
                }

                try
                {
                    twtmsg.FromScreenName = item["user"]["screen_name"].ToString().TrimStart('"').TrimEnd('"');
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.StackTrace);
                }

                try
                {
                    twtmsg.FromProfileUrl = item["user"]["profile_image_url"].ToString().TrimStart('"').TrimEnd('"');
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.StackTrace);
                }

                try
                {
                    twtmsg.InReplyToStatusUserId = item["in_reply_to_status_id_str"].ToString().TrimStart('"').TrimEnd('"');
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.StackTrace);
                }

                try
                {
                    twtmsg.SourceUrl = item["source"].ToString().TrimStart('"').TrimEnd('"');
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.StackTrace);
                } try
                {
                    twtmsg.ProfileId = twitterAccount.TwitterUserId;
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.StackTrace);
                } try
                {
                    twtmsg.EntryDate = DateTime.Now;
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.StackTrace);
                }
                if (!twtmsgrepo.checkTwitterMessageExists(twtmsg.MessageId))
                {
//.........这里部分代码省略.........
开发者ID:JBNavadiya,项目名称:socioboard,代码行数:101,代码来源:TwitterHelper.cs

示例4: AddTwitterAccount


//.........这里部分代码省略.........
                        {
                            Console.WriteLine(ex.StackTrace);
                        }

                        try
                        {
                            objTwitterMessage.EntryDate = DateTime.Now;
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.StackTrace);
                        }
                        if (!objTwitterMessageRepository.checkTwitterMessageExists(objTwitterMessage.MessageId))
                        {
                            objTwitterMessageRepository.addTwitterMessage(objTwitterMessage);
                        }

                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.StackTrace);
                    logger.Error("tl.Get_Statuses_Mentions_Timeline ex.StackTrace >> " + ex.StackTrace);
                    logger.Error("tl.Get_Statuses_Mentions_Timeline ex.Message >> " + ex.Message);
                }
                #endregion
                #region Add User Retweet
                twtuser = new TwitterUser();
                try
                {
                    JArray Retweet = null;
                    try
                    {
                        Retweet = twtuser.GetStatuses_Retweet_Of_Me(OAuth);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                        logger.Error("twtuser.GetStatuses_Retweet_Of_Me ex.StackTrace >> " + ex.StackTrace);
                        logger.Error("twtuser.GetStatuses_Retweet_Of_Me ex.Message >> " + ex.Message);
                    }
                    objTwitterMessage = new Domain.Socioboard.Domain.TwitterMessage();
                    foreach (var item in Retweet)
                    {
                        objTwitterMessage.UserId = Guid.Parse(UserId);
                        objTwitterMessage.Type = "twt_retweets";
                        objTwitterMessage.Id = Guid.NewGuid();

                        try
                        {
                            objTwitterMessage.MessageId = item["id_str"].ToString().TrimStart('"').TrimEnd('"');
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.StackTrace);
                        }
                        try
                        {
                            objTwitterMessage.MessageDate = Utility.ParseTwitterTime(item["created_at"].ToString().TrimStart('"').TrimEnd('"'));
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.StackTrace);
                        }
                        try
                        {
开发者ID:NALSS,项目名称:socioboard,代码行数:67,代码来源:Twitter.asmx.cs


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