Skip to content

Instantly share code, notes, and snippets.

@korrio
Created July 7, 2015 03:59
Show Gist options
  • Save korrio/afb30935f65658b1006e to your computer and use it in GitHub Desktop.
Save korrio/afb30935f65658b1006e to your computer and use it in GitHub Desktop.
noti request
var request = require('request');
var titile = "คุณได้รับข้อความใหม่";
var sender = {id: 6,name:"Hey"};
var message = "นาย " + sender.name + " ได้กดถูกใจคุณ";
var receiverId = 3082;
var notiType = 100;
request({
//uri: "http://api.vdomax.com/noti/",
uri: "http://chat.vdomax.com/noti/index.php?"+
"title="+titile+
"&m="+message+
"&f="+sender.id+
"&n="+sender.name+
"&t="+receiverId+
"&type="+notiType,
method: "GET",
timeout: 20000,
followRedirect: true,
maxRedirects: 10,
/*
qs: {
title: "VDOMax",
m: message,
f: sender.id || 0,
n: sender.name || "",
t: receiverId,
type: notiType
}
*/
}, function(error, response, body) {
// console.log(error);
console.log(body);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment