예제 #1
0
 public static TwitterDirectMessage FromNode(XElement node)
 {
     if (node == null)
     {
         throw new ArgumentNullException("node");
     }
     return(new TwitterDirectMessage()
     {
         Id = node.Element("id").ParseLong(),
         Text = node.Element("text").ParseString(),
         CreatedAt = node.Element("created_at").ParseDateTime("ddd MMM d HH':'mm':'ss zzz yyyy"),
         Sender = TwitterUser.FromNode(node.Element("sender")),
         Recipient = TwitterUser.FromNode(node.Element("recipient")),
         Entities = TwitterEntity.Parse(node.Element("entities")),
     });
 }
예제 #2
0
 public static TwitterStatus FromNode(XElement node)
 {
     if (node == null)
     {
         throw new ArgumentNullException("node");
     }
     return(new TwitterStatus()
     {
         Id = node.Element("id").ParseLong(),
         Text = node.Element("text").ParseString(),
         Source = node.Element("source").ParseString(),
         CreatedAt = node.Element("created_at").ParseDateTime("ddd MMM d HH':'mm':'ss zzz yyyy"),
         InReplyToStatusId = node.Element("in_reply_to_status_id").ParseLong(),
         InReplyToUserId = node.Element("in_reply_to_user_id").ParseLong(),
         InReplyToUserScreenName = node.Element("in_reply_to_screen_name").ParseString(),
         RetweetedOriginal = node.Element("retweeted_status") == null ? null : TwitterStatus.FromNode(node.Element("retweeted_status")),
         User = TwitterUser.FromNode(node.Element("user")),
         Entities = TwitterEntity.Parse(node.Element("entities")),
     });
 }