Hello, i wanted add comment on steam profile, what's wrong?
var SteamCommunity = require('../index.js');
var ReadLine = require('readline');
var fs = require('fs');
var SteamID = require('steamid');
var CEconItem = require('../classes/CEconItem.js');
var community = new SteamCommunity();
var rl = ReadLine.createInterface({
"input": process.stdin,
"output": process.stdout
});
rl.question("Username: ", function(accountName) {
rl.question("Password: ", function(password) {
doLogin(accountName, password);
});
});
function doLogin(accountName, password, captcha) {
community.login({
"accountName": accountName,
"password": password,
"captcha": captcha
}, function(err, sessionID, cookies) {
if(err) {
if(err.message == 'CAPTCHA') {
console.log(err.captchaurl);
rl.question("CAPTCHA: ", function(captchaInput) {
doLogin(accountName, password, captchaInput);
});
return;
}
console.log(err);
process.exit();
return;
}
console.log("Logged on!");
SteamCommunity.prototype.postUserComment = function(userID, message, callback) {
if(typeof userID === 'string') {
userID = new SteamID(userID);
}
var self = this;
this.httpRequestPost({
"uri": "https://steamcommunity.com/comment/Profile/post/76561198015482752",
"form": {
"comment": message,
"count": 6,
"sessionid": this.getSessionID()
},
"json": true
}, function(err, response, body) {
if(!callback) {
return;
}
if (err) {
callback(err);
return;
}
if(body.success) {
callback(null);
} else if(body.error) {
callback(new Error(body.error));
} else {
callback(new Error("Unknown error"));
}
}, "steamcommunity");
};
});
}