i've created one app at facebook-for developer site, (its not activated yet, since i don't have anything running as such, but i've created user-access-token on
developers.facebook.com), using which the graph-api explorer is able to run the APIs and provide correct and requested fields' data.
Now the quick goal of mine, is to write python code that talks using graph-api (using the created user-access-token) and get the facebook profile fields; which are granted for this user.
the code that i've right now is: test.py
import facebook
token = "EAAOGMQdS****************sLCpg2aLmmtyZCb5jUCShL"
graph = facebook.GraphAPI(access_token=token)
resp = graph.request(url)
print resp, resp.text, resp.reason
and whenever i try to run this program, the error that comes up is:
# python test.py
Traceback (most recent call last):
File "u.py", line 8, in <module>
resp = graph.request(url)
File "/usr/local/lib/python2.7/dist-packages/facebook/__init__.py", line 285, in request
files=files,
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 468, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 576, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 426, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', error(104, 'Connection reset by peer'))
Few more details:
Trying this on ubuntu machine, with facebook-sdk:3.1.0 (version auto picked by pip) & python version is 2.7