Event when new mention arrives

Feb 19, 2013 at 1:23 PM
My goal is to have an event executed whenever the logged-in user receives either a new mention or a new direct message since the application was started.
I believe this is done with the streaming API, though I'm not sure. Is streaming the right approach here?
Coordinator
Feb 19, 2013 at 3:07 PM
Hi,

You're correct - a stream would be a good approach. The UserStream operates on behalf of the logged in user and the SiteStream works for a list of users.

@JoeMayo
Feb 19, 2013 at 9:12 PM
How do I work with the UserStream? To be honest, I haven't seen any other library designed like yours before, so it's a bit difficult to understand your concepts
Coordinator
Feb 19, 2013 at 9:59 PM
It might help to review the Twitter Streaming API documentation since they have rules on how to connect. Essentially, I've wrapped a lot of the retry logic into LINQ to Twitter to help you minimize when you need to reconnect. However, you'll still need to watch for exceptions that occur when Twitter disconnects - and then reconnect with a new instance of TwitterContext.

This site has some documentation on the LINQ to Twitter implementation of streams. Also, you can download the source code and use the examples in the demo project.

Yes, LINQ to Twitter is different - thank you. :)

@JoeMayo
Feb 19, 2013 at 10:29 PM
Edited Feb 19, 2013 at 10:38 PM
I'm sorry, but I don't seem to understand your UserStream example very well.
What exactly does the userstream do? Or furthermore, what can I do with it and how do I "call" it?

EDIT:// Nevermind, I found it out. I was actually never creating it. Shame on me. For the past few days, this project is really tearing me apart