Skip to content

Instantly share code, notes, and snippets.

@tim-smart
Forked from amrnt/twi.js
Created August 31, 2010 01:15
Show Gist options
  • Save tim-smart/558359 to your computer and use it in GitHub Desktop.
Save tim-smart/558359 to your computer and use it in GitHub Desktop.
var sys = require('sys'),
http = require('http'),
ws = require("./vendor/ws"),
arrays = require('./vendor/arrays');
var headers = {};
headers['Host'] = "search.twitter.com";
var clients = [];
var twitter = http.createClient(80, "search.twitter.com");
var request = twitter.request("GET", "/search.json?q=rails", headers);
request.on('response', function (response) {
response.setEncoding("utf8");
var body = '';
response.on("data", function (chunk) {
body += chunk;
});
response.on('end', function () {
console.log(JSON.parse(body));
});
});
request.end();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment