public
anonymous / friendList.py
Created

ordered facebook friend list

  • Download Gist
friendList.py
Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
import urllib2
import json
 
# to run:
# from IDE: Run and type start()
# from command line: navigate to folder containing this file
# type python
# type execfile('friendList.py')
# type start()
 
def start():
url = 'http://graph.facebook.com/'
print "Go to facebook.com."
print "View the source."
print 'Find "InitialChatFriendsList"'
print 'Copy everything between ""list":" and "}],["PresencePrivacyInitialData"" EXACTLY.'
print '*It should look something like this, but with a lot more numbers: ["1234567","9876543","246810"]'
links = input("Paste that information here, then hit Enter \n")
num = input("How many friends do you want to see out of " + str(len(links)) + "? \n")
for link in links[:num]:
try:
source = json.load(urllib2.urlopen(url+link))
print str(links.index(link)+1) + ". " + source['name']
except urllib2.HTTPError, e:
print str(links.index(link)+1) + ". disabled account"
return

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.