I recently switched from TweetSharp to LinqToTwitter and the one thing I'm missing is a way to retrieve a tweet as HTML.
TweetSharp had a method called .TextAsHtml()
which automatically linked mentions, hash tags, and hyperlinks.
Does anyone know if such a feature exist in LinqtoTwitter? Any insight into how TweetSharp was able to accomplish this would be much appricated.
UPDATE:
It looks as though TweetSharp used Regular Expressions to match URLs, mentions, and hash tags. Here is a sample:
private static readonly Regex _parseUrls = new Regex("\\b(([\\w-]+://?|www[.])[^\\s()<>]+(?:\\([\\w\\d]+\\)|([^\\p{P}\\s]|/)))", RegexOptions.IgnoreCase | RegexOptions.Compiled);
private static readonly Regex _parseMentions = new Regex("(^|\\W)@([A-Za-z0-9_]+)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
private static readonly Regex _parseHashtags = new Regex("[#]+[A-Za-z0-9-_]+", RegexOptions.IgnoreCase | RegexOptions.Compiled);