本文整理汇总了C#中TweetSharp.TwitterService.ListTweetsOnFriendsTimeline方法的典型用法代码示例。如果您正苦于以下问题:C# TwitterService.ListTweetsOnFriendsTimeline方法的具体用法?C# TwitterService.ListTweetsOnFriendsTimeline怎么用?C# TwitterService.ListTweetsOnFriendsTimeline使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TweetSharp.TwitterService
的用法示例。
在下文中一共展示了TwitterService.ListTweetsOnFriendsTimeline方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: appbar_button1_Click
private void appbar_button1_Click(object sender, EventArgs e)
{
listdata.Visibility = Visibility.Collapsed;
listdata2.Visibility = Visibility.Collapsed;
listdata3.Visibility = Visibility.Collapsed;
listdata4.Visibility = Visibility.Collapsed;
loadtext.Visibility = Visibility.Visible;
pgbar.Visibility = Visibility.Visible;
var item = (PivotItem)title.SelectedItem;
string header = (string)item.Header;
service = new TwitterService("g8F2KdKH40gGp9BXemw13Q", "OyFRFsI05agcJtURtLv8lpYbYRwZAIL5gr5xQNPW0Q");
service.AuthenticateWith((string)settings["twitter_token"], (string)settings["twitter_tokensecret"]);
if (header == "recent")
{
service.ListTweetsOnFriendsTimeline(0, 40,
(tweets, response) =>
{
if (response.StatusCode == HttpStatusCode.OK)
{
DateTime ti = DateTime.Now;
DateTime now = ti.ToUniversalTime();
lists = new List<Tweet>();
foreach (var tweet in tweets)
{
Tweet tv = new Tweet();
TimeSpan tsp = now - tweet.CreatedDate;
tv.id = tweet.Id;
tv.name = tweet.User.ScreenName;
tv.thumb_img = tweet.User.ProfileImageUrl;
tv.text = tweet.Text + "\n";
if (tsp.Days > 0)
tv.time = tsp.Days + "일 전";
else if (tsp.Hours > 0)
tv.time = tsp.Hours + "시간 전";
else
tv.time = tsp.Minutes + "분 전";
lists.Add(tv);
}
Dispatcher.BeginInvoke(delegate()
{
if (lists.Count > 0)
{
loadtext.Visibility = Visibility.Collapsed;
pgbar.Visibility = Visibility.Collapsed;
listdata.ItemsSource = lists;
listdata.Visibility = Visibility.Visible;
}
else
{
pgbar.Visibility = Visibility.Collapsed;
loadtext.Text = "No items";
}
});
}
});
}
else if (header == "replies")
{
service.ListTweetsMentioningMe(0, 40,
(tweets, response) =>
{
if (response.StatusCode == HttpStatusCode.OK)
{
DateTime ti = DateTime.Now;
DateTime now = ti.ToUniversalTime();
lists = new List<Tweet>();
foreach (var tweet in tweets)
{
Tweet tv = new Tweet();
TimeSpan tsp = now - tweet.CreatedDate;
tv.id = tweet.Id;
tv.name = tweet.User.ScreenName;
tv.thumb_img = tweet.User.ProfileImageUrl;
tv.text = tweet.Text + "\n";
if (tsp.Days > 0)
tv.time = tsp.Days + "일 전";
else if (tsp.Hours > 0)
tv.time = tsp.Hours + "시간 전";
else
tv.time = tsp.Minutes + "분 전";
lists.Add(tv);
}
Dispatcher.BeginInvoke(delegate()
{
if (lists.Count > 0)
{
loadtext.Visibility = Visibility.Collapsed;
pgbar.Visibility = Visibility.Collapsed;
listdata2.ItemsSource = lists;
listdata2.Visibility = Visibility.Visible;
}
else
{
pgbar.Visibility = Visibility.Collapsed;
//.........这里部分代码省略.........
示例2: GetUpdates
public IEnumerable<ChannelStatusUpdate> GetUpdates(int pageSize)
{
var service = new TwitterService(ChannelHelper.ConsumerKey, ChannelHelper.ConsumerSecret, ChannelHelper.Token, ChannelHelper.TokenSecret);
var result = service.ListTweetsOnFriendsTimeline();
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
};
}
}