-
-
Save tim-smart/558359 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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