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


C# TwitterService.ListTweetsOnSpecifiedUserTimeline方法代码示例

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


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

示例1: Should_return_search_result

 public void Should_return_search_result()
 {
     var service = new TwitterService();
     var results = service.ListTweetsOnSpecifiedUserTimeline("pakarsaham", 40);
     foreach (var twitterStatuse in results)
     {
          Console.WriteLine(
         "Name: {0}, Tweet: {1}\n",
         twitterStatuse.User.ScreenName, twitterStatuse.Text);
     }
 }
开发者ID:adisembiring,项目名称:kultwit,代码行数:11,代码来源:When_search_with_twitsharp.cs

示例2: Execute

        public void Execute(Bot bot)
        {
            var now = DateTime.Now;

            Debug.WriteLine(string.Format("Fetching from tha twatters! - {0:HH.mm.ss} < {1:HH.mm.ss}", lastRun, now));

            lastRun = now;

            var twitterService = new TwitterService(ConsumerKey, ConsumerSecret);

            twitterService.AuthenticateWith(Token, TokenSecret);

            List<TwitterStatus> latestTweets;

            if (latestTweet == null)
            {
                latestTweets = twitterService.ListTweetsOnSpecifiedUserTimeline(TwitterUserName, tweetLimit).ToList();
            }
            else
            {
                latestTweets = twitterService.ListTweetsOnSpecifiedUserTimelineSince(TwitterUserName, latestTweet.Id, tweetLimit).ToList();
            }

            if (!latestTweets.Any())
            {
                return;
            }

            latestTweet = latestTweets.First();

            foreach (var room in bot.Rooms)
            {
                bot.Say(string.Format("Latests tweets from @{0}", TwitterUserName), room);

                foreach (var tweet in latestTweets)
                {
                    bot.Say(tweet.TextDecoded, room);
                }
            }
        }
开发者ID:Raion,项目名称:jibbr,代码行数:40,代码来源:TwitterAnnouncer.cs

示例3: Index

        public ActionResult Index(TwitCommand command)
        {
            int size = 20;

            var service = new TwitterService();

            if (command.Size.HasValue)
                size = command.Size.Value;

            var results = service.ListTweetsOnSpecifiedUserTimeline(command.UserName, size);

            if (!string.IsNullOrWhiteSpace(command.HashTag))
                results = results.Where(tweet => tweet.Text.Contains(command.HashTag));

            results = results.OrderBy(tweet => tweet.CreatedDate);

            foreach (var tweet in results)
            {
                command.Result += string.Format("{0}",
                tweet.Text) + "</br></br>";
            }
            return View(command);
        }
开发者ID:adisembiring,项目名称:kultwit,代码行数:23,代码来源:TwitSearchController.cs

示例4: GetUserUpdates

        public IEnumerable<ChannelStatusUpdate> GetUserUpdates(string username, int count)
        {
            var service = new TwitterService(ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret, ChannelHelper.Token, ChannelHelper.TokenSecret);
            var result = service.ListTweetsOnSpecifiedUserTimeline(Int32.Parse(username));

            foreach (var tweet in result)
            {
                yield return new ChannelStatusUpdate
                {
                    ChannelStatusKey = tweet.Id.ToString(),
                    Status = tweet.Text,
                    From = new SourceAddress(
                        tweet.User.ScreenName,
                        tweet.User.Name,
                        tweet.User.ProfileImageUrl.Replace("_normal.jpg", "_mini.jpg")),
                    DatePosted = tweet.CreatedDate
                };
            }
        }
开发者ID:Klaudit,项目名称:inbox2_desktop,代码行数:19,代码来源:TwitterClientChannel.cs

示例5: Load

        protected void Load(TwitterResource resource)
        {
            var service = new TwitterService(SensitiveData.ConsumerToken, SensitiveData.ConsumerSecret, resource.User.Key, resource.User.Secret);

            switch (resource.Type)
            {
                case ResourceType.Home:
                    service.ListTweetsOnHomeTimeline(1, (status, response) => ReceiveTweetable(status.Cast<ITweetable>(), response, resource));
                    break;
                case ResourceType.Mentions:
                    service.ListTweetsMentioningMe(1, (status, response) => ReceiveTweetable(status.Cast<ITweetable>(), response, resource));
                    break;
                case ResourceType.Messages:
                    service.ListDirectMessagesReceived(1, (status, response) => ReceiveTweetable(status.Cast<ITweetable>(), response, resource));
                    break;
                case ResourceType.Favorites:
                    service.ListFavoriteTweets((status, response) => ReceiveTweetable(status.Cast<ITweetable>(), response, resource));
                    break;
                case ResourceType.List:
                    service.ListTweetsOnList(resource.Data.Substring(1, resource.Data.IndexOf('/') - 1),
                            resource.Data.Substring(resource.Data.IndexOf('/') + 1), 1, (status, response) => ReceiveTweetable(status.Cast<ITweetable>(), response, resource));
                    break;
                case ResourceType.Search:
                    service.Search(resource.Data, 1, 20, (status, response) => ReceiveTweetable(status.Statuses.Cast<ITweetable>(), response, resource));
                    break;
                case ResourceType.Tweets:
                    service.ListTweetsOnSpecifiedUserTimeline(resource.Data, 1, true, (status, response) => ReceiveTweetable(status.Cast<ITweetable>(), response, resource));
                    break;
            }
        }
开发者ID:Quertz,项目名称:Ocell,代码行数:30,代码来源:ScheduledAgent.cs


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