本文整理汇总了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);
}
}
示例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);
}
}
}
示例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);
}
示例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
};
}
}
示例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;
}
}