HTML of tweet

May 30, 2012 at 1:18 PM


I was using Linq To Twitter a while ago and then I had the Content property of  a tweet containing html with linked href's and hashtags. Now I can only find the text property without html.

Am I missing something?


Thanks in advance,


May 30, 2012 at 2:31 PM

Hi Cyril,

It sounds like you're using Search.  LINQ to Twitter used to use XML (more specifically, ATOM for Search), but is now using JSON for Twitter queries.  The HTML markup isn't available in the JSON format.  One of the main reasons I took this direction is because the Twitter API only provides new features in JSON.  Some of the new APIs are only in JSON (RSS is supported too).  Additionally, JSON is Twitter's preferred format, it's more compact, and provides better performance.

If it might be helpful, please look at the Entities property for details on hashtags, links, and media - located on the returned Search entity here:

    - Results
        -- SearchEntry
            --- Entities
        -- SearchEntry
            --- Entities
        --- ...


May 30, 2012 at 2:36 PM

Ok thanks....I see.

The old binary is still working though, but you're saying it will be deprecated? Hope not to soon because some of my old projects still rely on them :)

I'll look into the new JSON entities...



May 30, 2012 at 2:50 PM

The old LINQ to Twitter binaries might still work on Search, but they aren't supported.  Twitter recently deprecated several parts of their API, but in the case of Search, they added new features that aren't supported in ATOM (XML).  JSON is the format being used behind the scenes and you generally only need to work with the LINQ to Twitter objects returned to you. 

The Documentation on this site has more information on what's available in LINQ to Twitter, including Search and more.


May 30, 2012 at 3:10 PM

Thanks for your quick response!

One last question. Are there examples somewhere of how to parse the dateoffset in the CreatedAt property of a tweet to a readable format?


May 30, 2012 at 3:17 PM

The LINQ to Twitter source code uses DateTime.ParseExact.  IIRC, the Twitter time coming in is at +0000, GMT.