Skip to content

Instantly share code, notes, and snippets.

@jimmyjacobson
Created February 7, 2012 20:48
Show Gist options
  • Save jimmyjacobson/1761854 to your computer and use it in GitHub Desktop.
Save jimmyjacobson/1761854 to your computer and use it in GitHub Desktop.
var http = require('http');
var redis = require("redis")
, db = redis.createClient();
function main(callback) {
var options = {
host: "search.twitter.com",
port: 80,
path: "/search.json?q=momolv"
};
http.get(options, function(res) {
var data = '';
res.on('data', function(chunk) {
data += chunk;
});
res.on('end', function() {
data = JSON.parse(data);
for (var p in data.results) {
console.log(data.results[p].from_user);
db.sadd('vegastech:momolv:tweets', data.results[p].from_user);
}
callback('done');
});
});
}
main(function(status) {
console.log(status);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment