Created
October 20, 2015 09:36
-
-
Save cannorin/9cf1c7d8378d835865d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using CoreTweet.Streaming; | |
var q = new Queue<Status>(); | |
var buffer = 1000; | |
foreach(var t in tokens.Streaming.User()) | |
{ | |
if(t is StatusMessage) | |
{ | |
if(q.Count >= buffer) q.Dequeue(); | |
q.Enqueue((t as StatusMessage).Status); | |
} | |
else if(t is DeleteMessage) | |
{ | |
var d = q.FirstOrDefault(x => x.Id == (t as DeleteMessage).Id); | |
if(d != null) | |
Console.WriteLine("DELETED> @{0}: {1}", d.User.ScreenName, d.Text); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment