Skip to content

Instantly share code, notes, and snippets.

@kylestev
Created December 2, 2012 22:53
Show Gist options
  • Select an option

  • Save kylestev/4191441 to your computer and use it in GitHub Desktop.

Select an option

Save kylestev/4191441 to your computer and use it in GitHub Desktop.
This is for acquiring the "OrderedFriends" list that is rumored to tell you who visits your profile the most. This is more likely fiction than fact, though.
function getScriptIndex() {
for (var i = 0; i < scripts.length; i++) {
if (scripts[i].innerText.indexOf("OrderedFriends") > -1) {
return i;
}
}
return -1;
}
var sindex = getScriptIndex();
if (sindex > -1) {
var script = scripts[sindex].innerText;
var findex = script.indexOf("OrderedFriendsListInitialData");
var ids = JSON.parse(script.substring(findex + 42, script.indexOf("]", findex + 50) + 1));
console.log(ids);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment