Oct 9, 2013 at 4:17 PM
Edited Oct 9, 2013 at 4:19 PM
Joe, you must get a ton of newbie questions like this but please bear with me. I'm a new programmer and I'm translating your C# examples to VB as I go too. I am able to authenticate and send a status update/DM. I'd now like to start using a UserStream
to see received DMs and tweets. I'm using a console application. I can see calls (using fiddler) to api.twitter.com for my verify_credentials request and my direct_message request. But when I execute the following code I see no request to api.twitter.com to
set up the stream. I'm assuming I should see something in order to establish the stream right?
Code (tctx is my twitter context):
Dim result = (From strm In tctx.UserStream Where strm.Type = UserStreamType.User _
If (strm.Status = TwitterErrorStatus.RequestProcessingException) Then
Log.Debug("Result of stream: " & strm.Content)
I also tried the JSON parser you recommend in the docs - there's not much in the way of examples, but I created a parser and then added two event handlers:
parser = tctx.UserStream.Where(Function(us) us.Type = UserStreamType.User).CreateParser()
Public Sub foo(sender As Object, e As UserStreamReceivedStatusEventArgs) Handles parser.ReceivedStatus
Log.Debug("Status: " & e.Json.ToString)
Public Sub bar(sender As Object, e As UserStreamReceivedFriendsEventArgs) Handles parser.ReceivedFriends
Log.Debug("Friends: " & e.Json.ToString)
The 'bar' sub gets called an I get a list of my friends (as per the twitter API) but when I send a status update from a friends account, I expect 'foo' to get called but I get the below exception, which I don't understand.
An unhandled exception of type 'System.MissingMethodException' occurred in LinqToTwitter.dll
Additional information: Method not found: 'LinqToTwitter.Status LinqToTwitter.Status.CreateStatus(System.Xml.Linq.XElement)'.
Could you shed some light for me please?