Skip to content

Instantly share code, notes, and snippets.

@orenmazor
Created October 18, 2011 17:16
Show Gist options
  • Save orenmazor/1296011 to your computer and use it in GitHub Desktop.
Save orenmazor/1296011 to your computer and use it in GitHub Desktop.
talking to getclicky from node
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