public Tweet(string fromString) { this.fromString = fromString; string[] tokens = fromString.Split ('|'); string noisedTime = tokens[Tweet.DATETIME_INDEX].Split(':')[0]; string hour = new String (noisedTime.ToCharArray(), noisedTime.Length - 2, 2); this.time = Int32.Parse (hour); //Sat Mar 08 05:30:03 +0000 2014 this.dateTime = DateTime.ParseExact (tokens[Tweet.DATETIME_INDEX], "ddd MMM dd HH:mm:ss zzz yyyy", CultureInfo.InvariantCulture); this.location = new Location (new Coordinate (tokens [Tweet.LONG_INDEX]), new Coordinate (tokens [Tweet.LAT_INDEX])); tokens = tokens [Tweet.TWEET_INDEX].Split (' '); this.tweet = ""; foreach (var token in tokens) { if (token.StartsWith ("http:") == false && token.StartsWith ("https:") == false) { this.tweet += token + " "; } } }
public Tweet(string tweet, int time, Location location) { this.tweet = tweet; this.time = time; this.location = location; }