本文整理汇总了C#中TweetSharp.TwitterService.ListTweetsOnList方法的典型用法代码示例。如果您正苦于以下问题:C# TwitterService.ListTweetsOnList方法的具体用法?C# TwitterService.ListTweetsOnList怎么用?C# TwitterService.ListTweetsOnList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TweetSharp.TwitterService
的用法示例。
在下文中一共展示了TwitterService.ListTweetsOnList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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(new ListTweetsOnHomeTimelineOptions { Count = 1, IncludeEntities = true }, (status, response) => ReceiveTweetable(status.Cast<ITweetable>(), response, resource));
break;
case ResourceType.Mentions:
service.ListTweetsMentioningMe(new ListTweetsMentioningMeOptions { Count = 1, IncludeEntities = true }, (status, response) => ReceiveTweetable(status.Cast<ITweetable>(), response, resource));
break;
case ResourceType.Messages:
service.ListDirectMessagesReceived(new ListDirectMessagesReceivedOptions { Count = 1 }, (status, response) => ReceiveTweetable(status.Cast<ITweetable>(), response, resource));
break;
case ResourceType.Favorites:
service.ListFavoriteTweets(new ListFavoriteTweetsOptions { Count = 1 }, (status, response) => ReceiveTweetable(status.Cast<ITweetable>(), response, resource));
break;
case ResourceType.List:
service.ListTweetsOnList(new ListTweetsOnListOptions
{
IncludeRts = false,
Count = 1,
OwnerScreenName = resource.Data.Substring(1, resource.Data.IndexOf('/') - 1),
Slug = resource.Data.Substring(resource.Data.IndexOf('/') + 1)
}, (status, response) => ReceiveTweetable(status.Cast<ITweetable>(), response, resource));
break;
case ResourceType.Search:
service.Search(new SearchOptions { Count = 1, IncludeEntities = true, Q = resource.Data }, (status, response) => ReceiveTweetable(status.Statuses.Cast<ITweetable>(), response, resource));
break;
case ResourceType.Tweets:
service.ListTweetsOnUserTimeline(new ListTweetsOnUserTimelineOptions { Count = 1, ScreenName = resource.Data, IncludeRts = true }, (status, response) => ReceiveTweetable(status.Cast<ITweetable>(), response, resource));
break;
}
}
示例2: 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;
}
}