Example #1
0
        void Event(TwitterStreamEvent e)
        {
            if (this.st == StartType.UserStream)
            {
                switch (e.EventType.ToString())
                {
                case "Favorite":
                    if (ExtendedOAuthTokens.Tokens.Any((x) => { return(x.UserName == e.Target.ScreenName); }))
                    {
                        MConsole.WriteLine(e.Source.ScreenName + " Favorited your tweet.");
                    }
                    break;

                case "Retweet":
                    if (ExtendedOAuthTokens.Tokens.Any((x) => { return(x.UserName == e.Target.ScreenName); }))
                    {
                        MConsole.WriteLine(e.Source.ScreenName + " Retweeted your tweet.");
                    }
                    break;

                case "Follow":
                    if (ExtendedOAuthTokens.Tokens.Any((x) => { return(x.UserName == e.Target.ScreenName); }))
                    {
                        MConsole.WriteLine(e.Source.ScreenName + " Followed you.");
                    }
                    break;
                }
            }
        }
 static void OtherEvent(TwitterStreamEvent e)
 {
     if (!jsonView)
     {
         Console.WriteLine(string.Format("Other event. Type: {0}; From: {1}; {2}", e.EventType, e.Source.ScreenName, e.TargetObject));
     }
 }
Example #3
0
        void OnEvent(TwitterStreamEvent @event)
        {
            Trace.Call(@event);

            try {
            } catch (Exception ex) {
#if LOG4NET
                Logger.Error("OnEvent()", ex);
#endif
            }
        }
 void OtherEvent(TwitterStreamEvent e)
 {
     this._otherEvents.Add(e.EventType);
 }
 public static StreamMessageEvent ParseJson(string json)
 => new StreamMessageEvent(TwitterStreamEvent.ParseJson(json), json);
 public TwitterStreamEvent <T> ParseTargetObjectAs <T>()
 => TwitterStreamEvent <T> .ParseJson(this.Json);
 public StreamMessageEvent(TwitterStreamEvent eventData, string json)
 {
     this.Event = eventData;
     this.Json  = json;
 }
 private void Callback(TwitterStreamEvent eventdetails)
 {
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="e"></param>
 /// <remarks>Example override: string message = string.Format("Other event. Type: {0}; From: {1}; {2}", e.EventType, e.Source.ScreenName, e.TargetObject);</remarks>
 public virtual void OtherEvent(TwitterStreamEvent e)
 {
     string message = string.Format("Other event. Type: {0}; From: {1}; {2}", e.EventType, e.Source.ScreenName, e.TargetObject);
 }