Get Json Source of Results, Is It Possible?

Mar 23, 2012 at 3:10 AM

What I'm trying to achieve is run a service that collects certain tweets and save them to the database for further analytical code to run.

I need to keep every piece of information like reply-to, source, entities, etc.. as the analytics code evolves and would be nice to be able to improve results on already captured tweets.

The easiest way to do this sort of thing sounds like storing the raw JSON of the tweet in something like MongoDb.

TweetSharp has a property in its objects called "RawSource" which gives access to the JSON source returned from twitter, however, I don't like the support message in the homepage of the other library, and in general, I had a successful personal project using LinqToTwitter, and hoping the same for this other personal toy project as well.

Is there any similar property in LinqToSql? Alternatively, is there any certain hook in the context or something related to it that I use to get the returned JSON of a LINQ query (or preferably of each tweet object indidually)?


Thanks a lot.

Mar 23, 2012 at 4:34 AM


You can get the result string from the RawResult property of the TwitterContext instance.  It will be the most current result.  Most results are still XML, but requests for Account, Search, and Trend will be JSON.  I have an ongoing project to convert all queries to JSON.

Also, LINQ to Twitter has a query type called RawQuery, which I blogged about here:

This gives you full control of the query string, including the ability to switch the .xml for .json and get JSON formatted results back.