Starship Enterprise / Roars in space, which is silent. / Damn those physics laws!
3
   
Award
Favorite
Favorited
Unfavorite
Download
"var array = avatars.pool
, found = {}
, new_avatars = [];
(find_avatar_url = (index = 0) => {
if (index == array.length) {
return console.log('done');
}
if (array[index][0] in found) {
new_avatars.push([found[''+array[index][0]], array[index][1]]);
console.log('found: ' + array[index][0] + "/" + array[index][1]);
find_avatar_url(index+1);
} else {
jQuery.get('/steamproxy.com/ogg/' + array[index][0] + '/Avatar/List'
).fail(function() {
console.log('FAIL, request_avatar_url: ' + avatar[0]);
setTimeout(find_avatar_url, 3000, index);
}).done(function(data) {
var url = '';
try {
url = jQuery(data).find('p.returnLink a')[0].href.substr(33); // XXX can ♥♥♥♥ up use try catcach?
} catch (e) {
console.log(e);
return setTimeout(find_avatar_url, 3000, index);
}
found[''+array[index][0]] = url;
new_avatars.push([url, array[index][1]]);
console.log('new: ' + url + "/" + array[index][1]);
setTimeout(find_avatar_url, 3000, index+1);
});
}
})();

////////////////////////////////////////////////////////////////////////////////
// request proper avatar url and change
avatar = pool_elements(avatars, 1, null)[0];
http_request('ogg/' + avatar[0] + '/Avatar/List', {}, (body, response, err) => {
http_request(Cheerio.load(body)('p.returnLink a')[0].attribs.href + '/selectAvatar', { selectedAvatar: avatar[1] });
});
////////////////////////////////////////////////////////////////////////////////
// change avatar
avatar = pool_elements(avatars, 1, null)[0];
http_request('https://steamproxy.com/games/' + avatar[0] + '/selectAvatar', { selectedAvatar: avatar[1] });"
1 Comments
ninezix 17 Jun, 2019 @ 2:22pm 
wtf