Exemplo 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);
        }
Exemplo 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);
                }
            });
        }
Exemplo 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);
        }