left the door open, / in comes my mother to talk. / be careful with porn
6
   
Award
Favorite
Favorited
Unfavorite
Download
"XXX RETRIEVE OLD BACKUP OF THE FUNCTION
/*http_request = (account, endpoint, data = null, callback = null, method = 'GET', json = true, retries = 0, force = false) => {
if (retries == 3) {
return;
}
if (data != null && typeof data !== 'string') {
data.sessionid = account.community.getSessionID();
method = 'POST';
}
endpoint = endpoint.replace(/http.*:/steamproxy.com/, '');
var options = {
"uri": endpoint,
"method": method,
"form": (typeof data == 'string' ? 'sessionID=' + account.community.getSessionID() + data : data),
"json": json,
};
if (options.uri.indexOf('http') == -1) {
options.uri = ('https://steamproxy.com/' + options.uri).replace("/my/", "/" + profile_url(account) + "/");
}
if (!json) {
options.encoding = null;
}
account.community.httpRequest(options, (err, response, body) => {
var result = endpoint.replace(/http.*:\/\//, '').replace(/^www./, '').replace(
"steamcdn-a.akamaihd.net/steamcommunity/public/images/", '') + ": " + (method + '-').yellow
, success = false;
if (err && err.message == 'Malformed JSON response') {
err = 0;
}
if (!response) {
result = "FAILURE" + " | " + result + '???=NO RESPONSE'.yellow;
} else {
var response_code = response.statusCode.toString();
result = result + response_code.yellow
if (!body && response_code != '302' && response_code != '200') {
result = "FAILURE" + " | " + result + "=NO BODY".yellow;
} else if (err && !(endpoint == 'my/edit' && response_code == 500)) {
if (response_code == '400' || response_code == '302') {
return setTimeout(() =>
http_request(account, endpoint, data, callback, method, json, retries+1), 1000);
}
result = "FAILURE" + " | " + result + ("=" + err.message).yellow;
} else if (body && typeof body.success != 'undefined' && body.success != 1) {
var error = (body.error) ? body.error.replace(/ /g, '').substr(0,30) : SteamCommunity.EResult[body.success];
result = "FAILURE" + " | " + result + ("=" + error).yellow;
if (error == 'NotLoggedOn') {
account.user.webLogOn();
}
} else if (body && body.toString().indexOf("g_steamID = false;") > -1) {
result = "FAILURE" + " | " + result + "=SteamIDIsFalse".yellow;
} else {
success = true;
result = "SUCCESS" + " | " + result;
}
}
if (!success || verbose == 1 || retries > 2) {
log(account, result.replace('POST-', 'POST'.inverse + '-'));
}
if (callback !== null && (success|| force)) {
callback(body, response, err);
}
});
return true;
}*/"