Skip to content

Instantly share code, notes, and snippets.

@lessandro
Last active December 13, 2015 23:29
Show Gist options
  • Save lessandro/4991703 to your computer and use it in GitHub Desktop.
Save lessandro/4991703 to your computer and use it in GitHub Desktop.
# livescript:
<-! $ document .ready
twitter = new ctwitter.CTwitter()
stream <-! twitter.stream \statuses/filter,
lang: \en
track: <[ ruby rails obama ]>
tweet <-! stream.on \data
$ \.tweets .prepend \<p> + tweet.text + \</p>
# compiled javascript:
$(document).ready(function(){
var twitter;
twitter = new ctwitter.CTwitter();
twitter.stream('statuses/filter', {
lang: 'en',
track: ['ruby', 'rails', 'obama']
}, function(stream){
stream.on('data', function(tweet){
$('.tweets').prepend('<p>' + tweet.text + '</p>');
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment