Created
October 18, 2011 17:16
-
-
Save orenmazor/1296011 to your computer and use it in GitHub Desktop.
talking to getclicky from node
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 http = require('http'); | |
var querystring = require('querystring'); | |
function getclick(remoteaddr,href,title,ref,ua) | |
{ | |
var site_id = ''; | |
var sitekey_admin = ''; | |
var params = {"site_id": site_id, | |
"sitekey_admin":sitekey_admin, | |
"ip_address":remoteaddr, | |
"href":href, | |
"title":title, | |
"ref":ref, | |
"ua":ua}; | |
var options = { | |
host: 'http://in.getclicky.com', | |
port: 80, | |
path: '/in.php?'+querystring.stringify(params, sep='&', eq='=') | |
}; | |
http.get(options, function(res) { | |
console.log("Got response: " + res); | |
}).on('error', function(e) { | |
console.log("Got error: " + e.message); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment