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

Commented Unassigned: Exception in Sample Stream [2225]

$
0
0
I am trying to start a sample stream using the below code, but the stream shutdowns as soon as it starts. I created a handler for StreamStopped and got the following exception. Can you look at the code and tell me its something which I am missing or its a problem with the library?

```
System.ArgumentNullException: Value cannot be null.
Parameter name: source
at AsyncExtensions.ReadLineAsync(TextReader source)
at Tweetinvi.Streams.Helpers.StreamResultGenerator.<StartStreamAsync>d__7.MoveNext()
```


```
TwitterCredentials.ApplicationCredentials = TwitterCredentials.CreateCredentials(ConfigurationManager.AppSettings["twitterAccessToken"], ConfigurationManager.AppSettings["twitterAccessTokenSecret"], ConfigurationManager.AppSettings["twitterConsumerKey"], ConfigurationManager.AppSettings["twitterConsumerSecret"]);

_sampleStream = Stream.CreateSampleStream();
_sampleStream.FilterTweetsToBeIn(Language.English);
_sampleStream.StreamStopped += (sender, args) =>
{
};
_sampleStream.TweetReceived += (sender, args) =>
{
if (args.Tweet.Text != null)
{
_tweetsCollection.Enqueue(args.Tweet);
}
};
_sampleStream.StartStream();
```
Comments: ** Comment from web user: linvi **

Well you must set your credentials otherwise you will never be able to access any endpoint of the Twitter API.
Now I agree that the error message should be more descriptive. I will have a look and probably throw a more detailed exception.

Thank you for reporting the problem.
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>