Skip to content

Instantly share code, notes, and snippets.

@blake8086
Created November 17, 2011 23:13
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blake8086/1374885 to your computer and use it in GitHub Desktop.
Save blake8086/1374885 to your computer and use it in GitHub Desktop.
Simple node.js server to stream Twitter 'Spritzer' level stream to client browser
global.server = require('http').createServer(function(request, response) {
global.twitterFeed = require('https').get({
auth: 'username:password',
host: 'stream.twitter.com',
path: '/1/statuses/sample.json',
}, function(res) {
res.setEncoding('utf8');
response.writeHead(200, 'text/plain');
res.on('data', function(chunk) {
response.write(chunk);
});
});
}).listen(8080);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment