Filter Stream by Language Using the API

Apr 3, 2014 at 2:09 AM
Edited Apr 3, 2014 at 2:11 AM
How can I filter a stream by language? This should be possible by changing the URL, as described here: https://dev.twitter.com/docs/streaming-apis/parameters#language.

However, I can't find a way to change the URL. The method described http://stackoverflow.com/questions/17082740/c-sharp-console-application-streaming-api-1-1-oauth#comment25269781_17266230, does not seem to be available in the API. Or is it?
Apr 3, 2014 at 11:31 PM
Hi,

This feature is not implemented by default on Tweetinvi because I did not had knowledge of this filter.
Though, you can do this easily on your own:
var s = Stream.CreateTweetStream();
s.TweetReceived += (sender, args) =>
{
    Console.WriteLine(args.Tweet.Text);
};
s.StartStream("https://stream.twitter.com/1.1/statuses/sample.json?language=fr");
Regards,
Linvi
Marked as answer by linvi on 4/4/2014 at 4:32 PM
Apr 4, 2014 at 4:02 PM
Edited Apr 4, 2014 at 4:03 PM
That works perfectly. Thanks!!!

BTW, thanks for the Tweetinvi API. It is simple and easy to use, works really well, and above all the support is excellent! :)
Apr 8, 2014 at 5:16 PM
Hi Sam,

This feature is now implemented in Tweetinvi 0.9.2.0!
Thank you for the review I appreciate it :)
var stream = Stream.CreateSampleStream();
stream.FilterTweetsToBeIn(Language.French);
stream.TweetReceived += (s, args) =>
{
    Console.WriteLine(args.Tweet.Text);
};
stream.StartStream();
Regards,
Linvi