0

i have installed pyfacebook as well as python sdk even the i am getting error as follows

when using this code

def tweet(request):
  ACCESS_TOKEN =   'CAACEdEose0cBANsWoohRpX91cxU9iSKr64W10ukQng40cizd8kZBIedVH23dy7ORYrsajdIDfuuqvcdzsO1ullj87zzH1WAkmP0qkZAkMFGNqQVgLOpEPv3F43s9vBZCOyTQ9v7cE2m7ZAHlY3lTVqyinZAgBRjO84AC9YgQ2VQT89LA7pnbzgmgylnCuUKoEd4CTrLVZAUgZDZD'
base_url = 'https://graph.facebook.com/me'
fields = 'id,name,friends.limit(10).fields(likes.limit(10))'
url = '%s?fields=%s&access_token=%s' % \
(base_url, fields, ACCESS_TOKEN,)
print (url)
content = requests.get(url).json()
print(json.dumps(content, indent=1))
g = facebook.GraphAPI(ACCESS_TOKEN)
friends = g.get_connections("me", "friends")['data']
likes = { friend['name'] : g.get_connections(friend['id'], "likes")['data']
      for friend in friends }
print(likes)
return render_to_responce("face.html",data)

1 Answer 1

1

i think you are using the wrong facebook plugin, try facebook-sdk

sudo pip uninstall facebook
sudo pip uninstall facebook-sdk
sudo pip install facebook-sdk
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.