Created
September 23, 2012 19:18
-
-
Save netsi1964/3772730 to your computer and use it in GitHub Desktop.
Create JSON data of people who like a FB page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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