I'm having a problem getting a picture in facebook. I'm using python plus facebook graph api. I research getting or how to download a picture in facebook so here's what i got.
import os
import json
import urllib
import pprint
ACCESS_TOKEN = 'ACCESS_TOKEN_SAMPLE'
host = "https://graph.facebook.com/v2.8"
path = "/me?fields=id,name,picture"
params = urllib.urlencode({"access_token": ACCESS_TOKEN})
url = "{host}{path}?{params}".format(host=host, path=path, params=params)
resp = urllib.urlopen(url).read()
getDATA = json.loads(resp)
os.system("echo " + str(getDATA) | tee >log.txt)
I tried to understand it but I'm having an error running this. Here's the error i got:
{uerror: {umessage: uAn active access token must be used to query information about the current user., ucode: 2500, utype: uOAuthException, ufbtrace_id: uGLoKMknFrR1}}
Also I'm trying to put the downloaded data to a log file. I need an output which has like a downloading progress or bar? Like when you run a speedtest in a terminal it shows the size of the data that it downloads.