Skip to content

Instantly share code, notes, and snippets.

@kalda341
Created February 3, 2015 21:27
Show Gist options
  • Save kalda341/d18968a31ad5c2a9f8e5 to your computer and use it in GitHub Desktop.
Save kalda341/d18968a31ad5c2a9f8e5 to your computer and use it in GitHub Desktop.
class Facbook:
def __init__(self, token):
self.token = token
self.graph = facebook.GraphAPI(token)
self.profile = self.graph.get_object("me")
def get_friends(self):
friends = self.graph.get_connections("me", "friends")
# To extract names
# friend_list = [friend['name'] for friend in friends['data']]
return friends
class Application:
def __init__(self, config):
facebook = Facebook(config.get('token'))
UI(facebook)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment