@J3, Paste this directly in chrome's console and hit enter. It's an answer to a question you asked the other day.
function sIdFromURL(dUrl) {
"use strict";
if (dUrl === 0) {dUrl = document.URL; }
dUrl = dUrl.match(/^https?:\/\/(services|secure)\.runescape\.com[\w\W]+\/(c=[A-Z0-9-*]+?[?=\/])/i);
return dUrl ? dUrl[2] : null;
}
function getFriends(sIdFromBG) {
"use strict";
var fList = [],
totalPages = 1,
fPno = 1;
function flReq() {
$.ajax({
url: 'ht
tp://services.runescape.com/' + sIdFromBG + 'm=website-data/playerFriendsDetails.json?resultsPerPage=24¤tPage=' + fPno + '&callback=?',
async: true,
dataType: 'jsonp',
timeout: 3000,
success: function (response) {
totalPages = response.totalPages;
console.log(Math.floor(fPno / totalPages * 100) + '%');
/*jslint unparam: true*/
$.each(response.friends, function (i, item) {
fList.push(item.name);
});
/*jslint unparam: false*/
fPno = fPno + 1;
if (fPno <= totalPages) {
setTimeout(function () {
flReq();
}, 1000);
} else {
console.log(fList);
}
},
error: function () {
//grrr
}
});
}
flReq();
}
getFriends(sIdFromURL(0));