public static TweetViewModel fromTweet(Tweet tweet)
 {
     return new TweetViewModel() {
         Text = tweet.text,
         Byline = bylineFor(tweet.created_at, tweet.username),
         tweet = tweet
     };
 }
Esempio n. 2
0
        public static Tweet oneFromJObject(JObject root)
        {
            Tweet tweet = new Tweet();

            tweet.text = (string)root["text"];

            JObject user = (JObject)root["user"];
            tweet.username = (string) user["screen_name"];

            string publishedTimestamp = (string) root["created_at"];
            tweet.created_at = parseTwitterTimestamp(publishedTimestamp);

            return tweet;
        }