Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

New Post: Hi! I created a stream and besides the text of a tweet, I want to get the coordinates.

$
0
0
Hi!

Thanks for the reply. After I submitted the post, I did just what you suggested and it worked.

I don't know if you are familiar with the SignalR framework, but I want to have the stream in a SignalR Hub class and to pass the tweets to JavaScript and, say make an alert on the webpage. I am experiencing some difficulties, mainly because I am not so familiar with anonymous functions in C#.
    public void TwitterStream()
    {
        TwitterCredentials.SetCredentials(...)
        var stream = Stream.CreateSampleStream();
        stream.TweetReceived += (sender, args) =>
        {
            Clients.All.alert(args.Tweet.Text);

        };

        stream.StartStream();
    }
Now, the alert function that is called is implemented in the JavaScript code.
Note that if I change the function so that it only passes a static message to the alert function, it will work.

Thanks!

Viewing all articles
Browse latest Browse all 4126

Trending Articles