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


C# TwitterUser.GetStatuses_Home_Timeline方法代码示例

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


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

示例1: getTwitterFeeds

        public void getTwitterFeeds(string UserId, oAuthTwitter OAuth)
        {
            TwitterUser twtuser;
            #region Add Twitter User Feed

            twtuser = new TwitterUser();
            try
            {
                JArray Home_Timeline = twtuser.GetStatuses_Home_Timeline(OAuth);
                objTwitterFeed = new Domain.Socioboard.Domain.TwitterFeed();
                foreach (var item in Home_Timeline)
                {
                    objTwitterFeed.UserId = Guid.Parse(UserId);
                    objTwitterFeed.Type = "twt_feeds";
                    try
                    {
                        objTwitterFeed.Feed = item["text"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.SourceUrl = item["source"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.ScreenName = objTwitterAccount.TwitterScreenName;
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.ProfileId = objTwitterAccount.TwitterUserId;
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.MessageId = item["id_str"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.FeedDate = Utility.ParseTwitterTime(item["created_at"].ToString().TrimStart('"').TrimEnd('"'));
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.InReplyToStatusUserId = item["in_reply_to_status_id_str"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.Id = Guid.NewGuid();
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.FromProfileUrl = item["user"]["profile_image_url"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.FromName = item["user"]["name"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.FromId = item["user"]["id_str"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
//.........这里部分代码省略.........
开发者ID:leaspb,项目名称:socioboard-core,代码行数:101,代码来源:Twitter.asmx.cs

示例2: getUserFeed

        public void getUserFeed(oAuthTwitter OAuth, string TwitterScreenName, string TwitterUserId, Guid userId)
        {
            try
            {
                //User user = (User)Session["LoggedUser"];
                TwitterUser twtuser = new TwitterUser();
                JArray data = twtuser.GetStatuses_Home_Timeline(OAuth);
                Domain.Socioboard.Domain.TwitterFeed objTwitterFeed;
                TwitterFeedRepository twtmsgrepo = new TwitterFeedRepository();
                //TwitterFeed twtmsg = new TwitterFeed();

                foreach (var item in data)
                {
                    objTwitterFeed = new Domain.Socioboard.Domain.TwitterFeed();
                    objTwitterFeed.UserId = userId;
                    objTwitterFeed.Type = "twt_feeds";
                    try
                    {
                        objTwitterFeed.Feed = item["text"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.SourceUrl = item["source"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.ScreenName = TwitterScreenName;
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.ProfileId = TwitterUserId;
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.MessageId = item["id_str"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.FeedDate = Utility.ParseTwitterTime(item["created_at"].ToString().TrimStart('"').TrimEnd('"'));
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.InReplyToStatusUserId = item["in_reply_to_status_id_str"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.Id = Guid.NewGuid();
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.FromProfileUrl = item["user"]["profile_image_url"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.FromName = item["user"]["name"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.FromId = item["user"]["id_str"].ToString().TrimStart('"').TrimEnd('"');
                    }
//.........这里部分代码省略.........
开发者ID:leaspb,项目名称:socioboard-core,代码行数:101,代码来源:Twitter.asmx.cs

示例3: getUserFeed

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

            TwitterFeedRepository twtmsgrepo = new TwitterFeedRepository();
            TwitterFeed twtmsg = new TwitterFeed();
            foreach (var item in data)
            {
                twtmsg.UserId = userid;
                twtmsg.Type = "twt_feeds";
                try
                {
                    twtmsg.Feed = item["text"].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.ScreenName = twitterAccount.TwitterScreenName;
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.StackTrace);
                }
                try
                {
                    twtmsg.ProfileId = twitterAccount.TwitterUserId;
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.StackTrace);
                }
                try
                {
                    twtmsg.MessageId = item["id_str"].ToString().TrimStart('"').TrimEnd('"');
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.StackTrace);
                }
                try
                {
                    twtmsg.FeedDate = SocioBoard.Helper.Extensions.ParseTwitterTime(item["created_at"].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.Id = Guid.NewGuid();
                }
                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.FromName = item["user"]["name"].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);
//.........这里部分代码省略.........
开发者ID:JBNavadiya,项目名称:socioboard,代码行数:101,代码来源:TwitterHelper.cs

示例4: getTwitterFeeds

        public void getTwitterFeeds(string UserId, oAuthTwitter OAuth)
        {
            //int J = 0;

            MongoRepository twitterfeedrepo = new MongoRepository("TwitterFeed");

            TwitterUser twtuser;
            #region Add Twitter User Feed

            twtuser = new TwitterUser();
            try
            {
                JArray Home_Timeline = twtuser.GetStatuses_Home_Timeline(OAuth);
                objTwitterFeed = new Domain.Socioboard.MongoDomain.TwitterFeed();
                foreach (var item in Home_Timeline)
                {
                    //objTwitterFeed.UserId = Guid.Parse(UserId);
                    objTwitterFeed.Type = "twt_feeds";
                    try
                    {
                        objTwitterFeed.Feed = item["text"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.SourceUrl = item["source"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.ScreenName = objTwitterAccount.TwitterScreenName;
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.ProfileId = objTwitterAccount.TwitterUserId;
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.MessageId = item["id_str"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.FeedDate = Utility.ParseTwitterTime(item["created_at"].ToString().TrimStart('"').TrimEnd('"')).ToString("yyyy/MM/dd HH:mm:ss");
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.InReplyToStatusUserId = item["in_reply_to_status_id_str"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.Id = ObjectId.GenerateNewId();
                        objTwitterFeed.strId = ObjectId.GenerateNewId().ToString();
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.FromProfileUrl = item["user"]["profile_image_url"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.FromName = item["user"]["name"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
//.........这里部分代码省略.........
开发者ID:socioboard,项目名称:socioboard-core,代码行数:101,代码来源:Twitter.asmx.cs

示例5: getUserFeed

        public void getUserFeed(oAuthTwitter OAuth, string TwitterScreenName, string TwitterUserId, Guid userId)
        {
            MongoRepository twitterfeedrepo = new MongoRepository("TwitterFeed");
            try
            {
                //User user = (User)Session["LoggedUser"];
                TwitterUser twtuser = new TwitterUser();
                JArray data = twtuser.GetStatuses_Home_Timeline(OAuth);
                Domain.Socioboard.MongoDomain.TwitterFeed objTwitterFeed;
                //TwitterFeedRepository twtmsgrepo = new TwitterFeedRepository();
                //TwitterFeed twtmsg = new TwitterFeed();

                foreach (var item in data)
                {
                    objTwitterFeed = new Domain.Socioboard.MongoDomain.TwitterFeed();
                    //objTwitterFeed.UserId = userId;
                    objTwitterFeed.Type = "twt_feeds";
                    try
                    {
                        objTwitterFeed.Feed = item["text"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.SourceUrl = item["source"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.ScreenName = TwitterScreenName;
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.ProfileId = TwitterUserId;
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.MessageId = item["id_str"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.FeedDate = Utility.ParseTwitterTime(item["created_at"].ToString().TrimStart('"').TrimEnd('"')).ToString("yyyy/MM/dd HH:mm:ss");
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.InReplyToStatusUserId = item["in_reply_to_status_id_str"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.Id = ObjectId.GenerateNewId();
                        objTwitterFeed.strId = ObjectId.GenerateNewId().ToString();
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.FromProfileUrl = item["user"]["profile_image_url"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
                        objTwitterFeed.FromName = item["user"]["name"].ToString().TrimStart('"').TrimEnd('"');
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.StackTrace);
                    }
                    try
                    {
//.........这里部分代码省略.........
开发者ID:socioboard,项目名称:socioboard-core,代码行数:101,代码来源:Twitter.asmx.cs

示例6: AddTwitterAccount


//.........这里部分代码省略.........
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.StackTrace);
                        }
                        objTwitterMessage.EntryDate = DateTime.Now;
                        try
                        {
                            objTwitterMessage.FromScreenName = item["user"]["screen_name"].ToString().TrimStart('"').TrimEnd('"');
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.StackTrace);
                        }
                        if (!objTwitterMessageRepository.checkTwitterMessageExists(objTwitterMessage.MessageId))
                        {
                            objTwitterMessageRepository.addTwitterMessage(objTwitterMessage);
                        }

                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.StackTrace);
                    logger.Error("twtuser.GetStatuses_User_Timeline ex.StackTrace >> " + ex.StackTrace);
                    logger.Error("twtuser.GetStatuses_User_Timeline ex.Message >> " + ex.Message);
                }
                #endregion
                #region Add Twitter User Feed

                twtuser = new TwitterUser();
                try
                {
                    JArray Home_Timeline = twtuser.GetStatuses_Home_Timeline(OAuth);
                    objTwitterFeed = new Domain.Socioboard.Domain.TwitterFeed();
                    foreach (var item in Home_Timeline)
                    {
                        objTwitterFeed.UserId = Guid.Parse(UserId);
                        objTwitterFeed.Type = "twt_feeds";
                        try
                        {
                            objTwitterFeed.Feed = item["text"].ToString().TrimStart('"').TrimEnd('"');
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.StackTrace);
                        }
                        try
                        {
                            objTwitterFeed.SourceUrl = item["source"].ToString().TrimStart('"').TrimEnd('"');
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.StackTrace);
                        }
                        try
                        {
                            objTwitterFeed.ScreenName = objTwitterAccount.TwitterScreenName;
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.StackTrace);
                        }
                        try
                        {
                            objTwitterFeed.ProfileId = objTwitterAccount.TwitterUserId;
开发者ID:NALSS,项目名称:socioboard,代码行数:67,代码来源:Twitter.asmx.cs


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