From ddee012e45d4a3a6e0d4e5cae20c6f27053007e7 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Wed, 8 Jun 2011 21:10:42 +0200 Subject: initial commit --- main.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 main.js diff --git a/main.js b/main.js new file mode 100755 index 0000000..dda62ba --- /dev/null +++ b/main.js @@ -0,0 +1,25 @@ +#!/usr/bin/env node + +var http = require("http"); + +http.get( + { host: 'api.twitter.com', + path: '/1/users/lookup.json?screen_name=spline' }, + + function (res) { + var data = ''; + res.setEncoding('utf8'); + + res.on('data', function (chunk) { + data = data + chunk; + }); + + res.on('end', function () { + data = JSON.parse(data); + + if (data.errors) { + console.log('User not found!'); + } + }); + } +); -- cgit v1.2.3-1-g7c22