private TileNotification TwitterObjectToNotification(TweetType type, string name, TwitterObject item) { var not = new TileNotification(); string userstring = ""; string from = "no_name"; if (item.TryGetProperty("user", out userstring)) new TwitterObject(userstring).TryGetProperty("screen_name", out from); else item.TryGetProperty("sender_screen_name", out from); not.From = from; not.Type = type; not.To = name; not.Message = item.GetProperty("text"); return not; }
private bool TwitterObjectIsOlderThan(TwitterObject item, DateTime date) { string content; if (!item.TryGetProperty("created_at", out content)) return false; DateTime objDate; const string format = "ddd MMM dd HH:mm:ss zzzz yyyy"; if (!DateTime.TryParseExact(content, format, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, out objDate)) return false; var d = objDate.ToUniversalTime(); return date < d; }