Esempio n. 1
0
 public DirectMessage(JsonObject json)
 {
     Id = json["id_str"];
     CreatedAt = json.GetDateTime("created_at");
     Text = json["text"];
     Sender = new User(json["sender"]);
     Recipient = new User(json["recipient"]);
 }
Esempio n. 2
0
        public Tweet(JsonObject json)
        {
            Text = json["text"]; // explicit conversion will unescape json
            Text = Text.UnescapeXml(); // unescape again for & escapes
            Source = json["source"];
            Id = json["id_str"];
            IsRetweet = json["retweeted"];
            InReplyToStatusId = json["in_reply_to_status_id_str"];
            InReplyToScreenName = json["in_reply_to_screen_name"];
            CreatedAt = json.GetDateTime("created_at");

            JsonValue entities;
            if (json.TryGetValue("entities", out entities))
                Entities = new Entities(entities);

            JsonValue retweetedStatus;
            if (json.TryGetValue("retweeted_status", out retweetedStatus))
                RetweetedStatus = new Tweet((JsonObject)retweetedStatus);

            User = new User(json["user"]);
        }