Esempio n. 1
0
        private static TwitterStream CreateClient()
        {
            var twStream = TwitterStream.Create(
                Properties.Settings.Default.ConsumerToken,
                Properties.Settings.Default.ConsumerSecret,
                Properties.Settings.Default.TokenValue,
                Properties.Settings.Default.TokenSecret);

            return(twStream);
        }
Esempio n. 2
0
        protected override void BecomingPrimary()
        {
            // Read Twitter auth information and topics of interest from App.config
            var twitterConfig = ReadTwitterInputConfig();

            // Create an observable of tweets with sentiment
            _inputObservable = TwitterStream.Create(twitterConfig);

            _inputObservable.ForEachAsync(
                x =>
            {
                if (x.IsData)
                {
                    Console.WriteLine("{0}", x.ToString());
                    thisProxy.OnNextFork(x);
                }
            });
        }
Esempio n. 3
0
        protected override async Task <bool> OnFirstStart()
        {
            // Read Twitter auth information and topics of interest from App.config
            var twitterConfig = ReadTwitterInputConfig();

            // Create an observable of tweets with sentiment
            var inputObservable = TwitterStream.Create(twitterConfig);

            _resilientTwitterProxy = GetProxy <IAnalyticsProxy>(AnalyticsServiceName);
            inputObservable.ForEachAsync(
                x =>
            {
                if (x.IsData)
                {
                    Console.WriteLine("{0}", x.ToString());
                    _resilientTwitterProxy.OnNextFork(x);
                }
            });

            return(true);
        }