Last active
November 9, 2015 19:07
-
-
Save egorvinogradov/9e0fd1196a14bc6b7910 to your computer and use it in GitHub Desktop.
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
javascript: (function (){ var scripts = document.getElementsByTagName('script'); var friendsList; for (var i = 0; i < scripts.length; i++) { var script = scripts[i]; if (script.innerHTML.indexOf('InitialChatFriendsList') > -1) { var friendsListString = script.innerHTML.split('"InitialChatFriendsList",[],{"list":')[1].split(',"groups"')[0]; friendsList = JSON.parse(friendsListString); console.log('friendsList:', friendsList); break; } } var html = friendsList.map(function(id, i){ id = id = id.split('-')[0]; var url = 'http://graph.facebook.com/' + id + '/picture?type=normal'; return '<a target="_blank" href="https://www.facebook.com/' + id + '"><img src="' + url + '"></a>'; }).join('\n'); var css = '<style> a { display: inline-block; margin: 7px; } img { max-width: 70px; max-height: 70px; vertical-align: top; } </style>'; open('data:text/html, <html>' + css + html + '</html>'); }()); |
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
var scripts = document.getElementsByTagName('script'); | |
var friendsList; | |
for (var i = 0; i < scripts.length; i++) { | |
var script = scripts[i]; | |
if (script.innerHTML.indexOf('InitialChatFriendsList') > -1) { | |
var friendsListString = script.innerHTML.split('"InitialChatFriendsList",[],{"list":')[1].split(',"groups"')[0]; | |
friendsList = JSON.parse(friendsListString); | |
console.log('friendsList:', friendsList); | |
break; | |
} | |
} | |
var html = friendsList.map(function(id, i){ | |
id = id = id.split('-')[0]; | |
var url = 'http://graph.facebook.com/' + id + '/picture?type=normal'; | |
return '<a target="_blank" href="https://www.facebook.com/' + id + '"><img src="' + url + '"></a>'; | |
}).join('\n'); | |
var css = '<style> a { display: inline-block; margin: 7px; } img { max-width: 70px; max-height: 70px; vertical-align: top; } </style>'; | |
open('data:text/html, <html>' + css + html + '</html>'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment