Passing streaming tweets from server to the client

Hey there guys. This may be an incredibly simple question but I’m just conceptually blanking. So I’m streaming tweets in and wanting to visualize them on a map. So far I have successfully gotten the tweets to stream in using https://atmospherejs.com/mrt/twit, so that’s all well and good.

What I’m conceptually blanking on is sending the tweets themselves over to the client.

I’m sure this is a basic question, but I’m having trouble with the concepts of a stream and then forwarding that data along. Any suggestions or directions would be greatly appreciated!

if (Meteor.isServer) {
    Meteor.startup(function () {
        // code to run on server at startup
        Twit = new TwitMaker({
            consumer_key: "xxxx",
            consumer_secret: "xxxx",
            access_token: "xxxxxx",
            access_token_secret: "xxxx"
        });

        var stream = Twit.stream('statuses/sample');

        stream.on('tweet', function (tweet) {
            console.log(tweet);
        })


    });
}
1 Like