Live data from Hacker News

Processing Twitter's Streaming API in .NET (with under 10 lines of code)

mikebosch.net

1–3 of 3 posts

Re: Processing Twitter's Streaming API in .NET (with under 10 lines of code)

#3
There's one less line of code if you use Encoding.UTF8 instead of instantiating your own object (although in principle the encoding is given to you in HttpWebResponse.ContentEncoding).

The Microsoft samples don't seem to do this, but consider putting your WebResponse and StreamReader objects in 'using' blocks: these classes implement IDisposable to ensure orderly cleanup.