Skip to content

Instantly share code, notes, and snippets.

@r14c
Created December 22, 2013 23:21
Show Gist options
  • Save r14c/8089638 to your computer and use it in GitHub Desktop.
Save r14c/8089638 to your computer and use it in GitHub Desktop.
// Facebook Profile Getter
// From Friend List
JSON.stringify(Array.prototype.slice.call($$('._698 img')).map(function (el) {
var parts = el.src.match(/(.*?\.net\/.*?)\/.*?\/([0-9]+_[0-9]+_[0-9]+_s\.jpg)/i);
return parts && [parts[1], parts[2].replace('s', 'n')].join('/');
}));
// From Photos
JSON.stringify(Array.prototype.slice.call($$('._6i9 .tagWrapper i')).map(function (el) {
var url = el.style.background.match(/url\((.*?)\)/),
parts = url[1] && url[1].match(/(.*?\.net\/.*?)\/.*?\/([0-9]+_[0-9]+_[0-9]+_n\.jpg)/i);
return parts && [parts[1], parts[2]].join('/');
}));
// ls
list.forEach(function (el) {
var a = document.createElement('a');
a.href = el;
a.appendChild(document.createTextNode(el));
document.body.appendChild(a);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment