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


C# TwitterUser.GetDirect_Messages_Sent方法代码示例

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


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

示例1: getTwitterDirectMessageSent

        public void getTwitterDirectMessageSent(string UserId, oAuthTwitter OAuth)
        {
            #region Add Twitter Direct Message
            TwitterUser twtuser = new TwitterUser();
            try
            {
                JArray Messages_Sent = twtuser.GetDirect_Messages_Sent(OAuth, 20);

                objTwitterDirectMessages = new Domain.Socioboard.Domain.TwitterDirectMessages();
                foreach (var item in Messages_Sent)
                {
                    objTwitterDirectMessages.UserId = Guid.Parse(UserId);
                    objTwitterDirectMessages.Type = "twt_directmessages_sent";
                    objTwitterDirectMessages.Id = Guid.NewGuid();

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

                    try
                    {
                        objTwitterDirectMessages.RecipientId = item["recipient"]["id_str"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }

                    try
                    {
                        objTwitterDirectMessages.RecipientScreenName = item["recipient"]["screen_name"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }

                    try
                    {
                        objTwitterDirectMessages.RecipientProfileUrl = item["recipient"]["profile_image_url"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }

                    try
                    {
                        objTwitterDirectMessages.SenderId = item["sender"]["id_str"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }

                    try
                    {
                        objTwitterDirectMessages.SenderScreenName = item["sender"]["screen_name"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    } try
                    {
                        objTwitterDirectMessages.SenderProfileUrl = item["sender"]["profile_image_url"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    } try
                    {
                        objTwitterDirectMessages.EntryDate = DateTime.Now;
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    if (!objTwitterDirectMessageRepository.checkExistsDirectMessages(objTwitterDirectMessages.MessageId))
                    {
//.........这里部分代码省略.........
开发者ID:leaspb,项目名称:socioboard-core,代码行数:101,代码来源:Twitter.asmx.cs

示例2: getSentDirectMessages

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

            TwitterDirectMessageRepository twtmsgrepo = new TwitterDirectMessageRepository();
            TwitterDirectMessages twtmsg = new TwitterDirectMessages();
            foreach (var item in data)
            {
                twtmsg.UserId = userid;
                twtmsg.Type = "twt_directmessages_sent";
                twtmsg.Id = Guid.NewGuid();

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

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

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

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

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

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


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