Exemplo n.º 1
0
        private void StreamTweets()
        {
            var stream = new TwitterStream(
                _options.Credential.ApiKey,
                _options.Credential.ApiSecret,
                _options.Credential.TokenKey,
                _options.Credential.TokenSecret
                );

            // Set Proxy
            if (!string.IsNullOrEmpty(_options.ProxyConnectionString))
            {
                stream.SetProxy(_options.ProxyConnectionString);
            }

            stream.StreamStarted      += stream_StreamStarted;
            stream.StreamStopped      += stream_StreamStopped;
            stream.TweetReceived      += stream_TweetReceived;
            stream.JsonObjectReceived += stream_JsonObjectReceived;

            stream.Start(_options.Track, _options.MatchCondition, _options.SearchLocations);
        }