I use LINQPad for all of my Twitter spelunking; it's simply one of the best tools I've used for exercising any code. It's a free utility (you only have to pay if you want statement autocompletion and some other nifty features, but you don't need them). If you don't run Windows then this won't be of much use to you, but if you have a Windows box you can use, then the ability to use the Dump()
method provide by LINQPad is just a massive timesaver.
###Using LINQPad
Using LINQPad
First you have to register an application with Twitter. Adam has a very nice writeup on setting up your application on dev.twitter.com in his answer.
Once you have your OAuth tokens, download and install LINQPad and the .NET Framework 4.0 (if you don't already have it.)
Next grab Twitterizer, which is a great .NET Twitter library. I'm using version 2.3.1 for this example. Unpack the ZIP file to a location you can reference later. Now we can get started.
Start LINQPad, click on the Query 1 window, and change the Language to C# Statements.
Next press F4 to open the Query Properties. On the Additional References tab click Browse... and find Twitterizer2.dll
where you extracted it earlier.
Now, click on the Additional Namespace Imports tab and type Twitterizer
into the window like so:
Now click OK, and we can write our query.
In the Query 1 window, enter the following code:
OAuthTokens tokens = new OAuthTokens();
tokens.ConsumerKey = "YourConsumerKey";
tokens.ConsumerSecret = "YourConsumerSecret";
tokens.AccessToken = "YourAccessToken";
tokens.AccessTokenSecret = "YourAccessSecret";
TwitterUser.Lookup(
tokens,
new LookupUsersOptions {
ScreenNames={"arcain","dotnetdevbuzz"}, IncludeEntities=true
}
).Dump(); // the magic happens here!
Now hit F5 to execute the query, and off LINQPad goes to Twitter to fetch your results.
The results using Dump()
are nicely formatted, and the entire object is rendered without having to reference anything explicitly, like so:
You can then click Export Results to export to Excel, Word, or just HTML, although you may want to reference some of the object fields directly to target your report data.
Oh, and you can apply Dump()
to just about anything, so it is a nice addition to any toolbox. Anyway, I hope you can make use of this as I find it a real time saver.
I finished the above, and then remembered the Twitter dev console, Twurl. Twurl is a bare-bones console that is available from the Apps tab on dev.twitter.com. It can be found by following a link on the right side of the page:
Now, Twurl would be great if it wasn't broken, but it still is. So, the next best thing (if you still want a webby console alternative to LINQPad) would be using a free service like apigee.com which supports OAuth as well.