Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

New Post: Simple stream not stopping when asked

$
0
0
Hi Yossi,

I have tested your code and everything is working perfectly well for me and I couldn't find anything that would make your code fail in the source code.
Here is the test I have used.
SimpleStream stream = new SimpleStream("https://stream.twitter.com/1.1/statuses/sample.json");

var tweets = new List<ITweet>();
stream.StartStream(token, tweet =>
{
    if (tweets.Count < 10)
    {
        if (tweet.Hashtags.Count > 0 && tweet.Text.StartsWith("RT") && tweet.Retweeting != null)
        {
            if (tweet.Retweeting.RetweetCount > 1)
            {
                tweets.Add(tweet.Retweeting);
            }

            Console.WriteLine(tweet.Text);
        }
    }
    else
    {
        stream.StopStream();
    }
});
Please try this code as is. If it does not work for you you might have credentials issues.
If it does but your code still fails I will need have to have a look at your code.
You can contact me privately through the contact form of codeplex and I will be more than happy to debug this for you.

Linvi

Viewing all articles
Browse latest Browse all 4126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>