Skip to content

Instantly share code, notes, and snippets.

@netsi1964
Created September 23, 2012 19:18
Show Gist options
  • Save netsi1964/3772730 to your computer and use it in GitHub Desktop.
Save netsi1964/3772730 to your computer and use it in GitHub Desktop.
Create JSON data of people who like a FB page
// Create JSON data of people who like a FB page
var s = 'var like = {"which":"' + $$('.pvs.phm._1yw')[0].innerText + '", "date":"' + new Date() + '", "people":[';
var l = $$('._13 a[href*="www.facebook.com"]');
var img = '';
for (var i = 0; i < l.length; i++) {
var href = l[i].href;
var name = l[i].innerText;
_img = l[i].getElementsByTagName('img');
img = (_img.length > 0) ? _img[0].src : img;
if (name != '' && href != '') {
s += ((i > 1) ? ', ' : '') + '{"href":"' + href + '","name":"' + name + '", "img":"' + img + '"}';
}
};
s += ']}';
var w = window.open();
w.document.write(s);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment