from facelib import Facebook

if __name__ == '__main__':
    # sample desktop application

    api_key = '3294ec05547430340a08adaceccd0eb3'
    secret_key = '1c70f03b2469077ae84f7b9c0ea1d81c'

    facebook = Facebook(api_key, secret_key)

    facebook.auth.createToken()

    # Show login window
    # Set popup=True if you want login without navigational elements
    facebook.login()

    # Login to the window, then press enter
    print 'After logging in, press enter...'
    raw_input()

    facebook.auth.getSession()
    print 'Session Key:   ', facebook.session_key
    print 'Your UID:      ', facebook.uid

    info = facebook.users.getInfo([facebook.uid], ['name', 'birthday', 'affiliations', 'sex'])[0]

    print 'Your Name:     ', info['name']
    print 'Your Birthday: ', info['birthday']
    print 'Your Gender:   ', info['sex']

    friends = facebook.friends.get()
    friends = facebook.users.getInfo(friends[0:5], ['name', 'birthday', 'relationship_status'])

    album = facebook.photos.getAlbums(facebook.uid)
    import epdb;epdb.st()
    for friend in friends:
        albums = facebook.photos.getAlbums(friend["uid"])
        print albums
        print friend["name"]
        for album in albums:
            print album["name"]
            print facebook.photos.get(album["aid"])["link"]
