Stream Parser for Linq2Twitter

This parser is based on azyobuzin's User Stream parser https://userstreamex.codeplex.com/ and allows you to parse, via Linq2Twitter, results from Twitter's Streaming API.

How to use it ?

var streamParser = 
(from strm in twitterContext.Streaming where strm.Type == StreamingType.Filter && strm.Track == "your keywords" select strm).CreateParser();

streamParser.ReceivedResult += (_sender, _args) =>
{ Console.WriteLine(_args.Tweet.id_long); };

streamParser.ParseContent();

Which information can be retrieved ?

- Tweet :

  • Tweet.id_long (long)
  • Tweet.id_str (string)
  • Tweet.createdAt (string)
  • Tweet.createdAtTime (DateTime)
  • Tweet.text (string)
  • Tweet.source (string)

- User :

  • Tweet.User.id_long (long)
  • Tweet.User.id_str (string)
  • Tweet.User.name (string)
  • Tweet.User.screen_name (string)
  • Tweet.User.profile_image_url (string)

- Geo :

  • Tweet.Geo.coordinates (List<string>)
  • Tweet.Geo.latitude (double / -200 if not specified)
  • Tweet.Geo.longitude (double / -200 if not specified)

Issues

There seems to be a problem when closing the stream. A SocketException is raised.

Last edited Mar 18 at 9:43 AM by Lilyh, version 14