當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。