本文整理汇总了C#中GlobusTwitterLib.App.Core.TwitterUser.GetDirect_Messages_Sent方法的典型用法代码示例。如果您正苦于以下问题:C# TwitterUser.GetDirect_Messages_Sent方法的具体用法?C# TwitterUser.GetDirect_Messages_Sent怎么用?C# TwitterUser.GetDirect_Messages_Sent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GlobusTwitterLib.App.Core.TwitterUser
的用法示例。
在下文中一共展示了TwitterUser.GetDirect_Messages_Sent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getTwitterDirectMessageSent
public void getTwitterDirectMessageSent(string UserId, oAuthTwitter OAuth)
{
#region Add Twitter Direct Message
TwitterUser twtuser = new TwitterUser();
try
{
JArray Messages_Sent = twtuser.GetDirect_Messages_Sent(OAuth, 20);
objTwitterDirectMessages = new Domain.Socioboard.Domain.TwitterDirectMessages();
foreach (var item in Messages_Sent)
{
objTwitterDirectMessages.UserId = Guid.Parse(UserId);
objTwitterDirectMessages.Type = "twt_directmessages_sent";
objTwitterDirectMessages.Id = Guid.NewGuid();
try
{
objTwitterDirectMessages.MessageId = item["id_str"].ToString().TrimStart('"').TrimEnd('"');
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
try
{
objTwitterDirectMessages.CreatedDate = Utility.ParseTwitterTime(item["created_at"].ToString().TrimStart('"').TrimEnd('"'));
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
try
{
objTwitterDirectMessages.Message = item["text"].ToString().TrimStart('"').TrimEnd('"');
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
try
{
objTwitterDirectMessages.RecipientId = item["recipient"]["id_str"].ToString().TrimStart('"').TrimEnd('"');
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
try
{
objTwitterDirectMessages.RecipientScreenName = item["recipient"]["screen_name"].ToString().TrimStart('"').TrimEnd('"');
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
try
{
objTwitterDirectMessages.RecipientProfileUrl = item["recipient"]["profile_image_url"].ToString().TrimStart('"').TrimEnd('"');
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
try
{
objTwitterDirectMessages.SenderId = item["sender"]["id_str"].ToString().TrimStart('"').TrimEnd('"');
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
try
{
objTwitterDirectMessages.SenderScreenName = item["sender"]["screen_name"].ToString().TrimStart('"').TrimEnd('"');
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
} try
{
objTwitterDirectMessages.SenderProfileUrl = item["sender"]["profile_image_url"].ToString().TrimStart('"').TrimEnd('"');
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
} try
{
objTwitterDirectMessages.EntryDate = DateTime.Now;
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
if (!objTwitterDirectMessageRepository.checkExistsDirectMessages(objTwitterDirectMessages.MessageId))
{
//.........这里部分代码省略.........
示例2: getSentDirectMessages
public void getSentDirectMessages(oAuthTwitter OAuth,TwitterAccount twitterAccount,Guid userid)
{
TwitterUser twtuser = new TwitterUser();
JArray data = twtuser.GetDirect_Messages_Sent(OAuth, 20);
TwitterDirectMessageRepository twtmsgrepo = new TwitterDirectMessageRepository();
TwitterDirectMessages twtmsg = new TwitterDirectMessages();
foreach (var item in data)
{
twtmsg.UserId = userid;
twtmsg.Type = "twt_directmessages_sent";
twtmsg.Id = Guid.NewGuid();
try
{
twtmsg.MessageId = item["id_str"].ToString().TrimStart('"').TrimEnd('"');
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
try
{
twtmsg.CreatedDate = SocioBoard.Helper.Extensions.ParseTwitterTime(item["created_at"].ToString().TrimStart('"').TrimEnd('"'));
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
try
{
twtmsg.Message = item["text"].ToString().TrimStart('"').TrimEnd('"');
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
try
{
twtmsg.RecipientId = item["recipient"]["id_str"].ToString().TrimStart('"').TrimEnd('"');
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
try
{
twtmsg.RecipientScreenName = item["recipient"]["screen_name"].ToString().TrimStart('"').TrimEnd('"');
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
try
{
twtmsg.RecipientProfileUrl = item["recipient"]["profile_image_url"].ToString().TrimStart('"').TrimEnd('"');
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
try
{
twtmsg.SenderId = item["sender"]["id_str"].ToString().TrimStart('"').TrimEnd('"');
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
try
{
twtmsg.SenderScreenName = item["sender"]["screen_name"].ToString().TrimStart('"').TrimEnd('"');
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
} try
{
twtmsg.SenderProfileUrl = item["sender"]["profile_image_url"].ToString().TrimStart('"').TrimEnd('"');
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
} try
{
twtmsg.EntryDate = DateTime.Now;
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
if (!twtmsgrepo.checkExistsDirectMessages(twtmsg.MessageId))
{
//.........这里部分代码省略.........