Source Code for Me (s-c.me)

Allows you to paste souce code to blogs! Adapted for Twitter! Here is Search Form in case you missed your code.
Code:
Selected Language:
Show Linenumbers:
Short link for Twitter:
HTML:

HTML view:

Copy Source | Copy HTML
  1. public override void Work(object sender, ElapsedEventArgs e)
  2. {
  3.     try
  4.     {
  5.         var uso = new UserStreamOptions()
  6.                                     {
  7.                                         AllReplies = true,
  8.                                         Count = -100,//отмотаем 100 назад
  9.                                         Track = new List<string>(
  10.                                             "слово1,слово2,слово3".Split(','))
  11.                                     };
  12.         TwitterStream stream = new TwitterStream(tokens, Twitter.appName, uso);
  13.         IAsyncResult result = stream.StartPublicStream(
  14.             StreamStopped,
  15.             NewTweet,
  16.             DeletedTweet,
  17.             OtherEvent
  18.         );
  19.         // Wait for the WaitHandle to become signaled.
  20.         result.AsyncWaitHandle.WaitOne();
  21.         // Close the wait handle.
  22.         result.AsyncWaitHandle.Close();
  23.     }
  24.     catch (Exception exception)
  25.     {
  26.         FireException(exception);
  27.     }
  28. }




Based on Manoli.Net's CodeFormatter. Made by Topbot (c) 2008-2018