Created
December 6, 2012 07:53
-
-
Save anonymous/4222619 to your computer and use it in GitHub Desktop.
ordered facebook friend list
This file contains 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
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 "OrderedFriendsListInitialData"' | |
print 'Copy everything between ""list":" and "}]],"require":" EXACTLY.' | |
print "Include the [] at the ends." | |
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 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment