我在https://developers.facebook.com/tools/explorer?fql=中使用了以下查询
SELECT aid FROM album WHERE owner = "100001741044617";
我得到了正确的输出。
我尝试通过 python 使用相同的查询并提取我遇到问题的输出。我正在发布 python 代码和输出
代码:
import urllib
query = "SELECT aid FROM album WHERE owner = \"100001741044617\""
print(query)
query = urllib.quote(query)
print(query)
url = "https://graph.facebook.com/fql?q=" +query
data = urllib.urlopen(url).read()
print(data)
输出
[root@IN-AIR-BIMAPP106 ~]# python /opt/fql.py
SELECT aid FROM album WHERE owner = "100001741044617"
SELECT%20aid%20FROM%20album%20WHERE%20owner%20%3D%20%22100001741044617%22
{"error":{"message":"A user access token is required to request this resource.","type":"OAuthException","code":102}}
我已经生成了所需的访问令牌 user_photoes。请让我知道该怎么做。谢谢。