Python facebook API中的oauth_访问_令牌
我正在尝试使用facebook api访问我的facebook个人资料。我的python代码如下所示:Python facebook API中的oauth_访问_令牌,python,facebook,user-interface,token,Python,Facebook,User Interface,Token,我正在尝试使用facebook api访问我的facebook个人资料。我的python代码如下所示: import facebook graph = facebook.GraphAPI("oauth_access_token") profile = graph.get_object("me") friends = graph.get_connections("me", "friends") graph.put_object("me", "feed", message="I am writin
import facebook
graph = facebook.GraphAPI("oauth_access_token")
profile = graph.get_object("me")
friends = graph.get_connections("me", "friends")
graph.put_object("me", "feed", message="I am writing on my wall!")
我已经创建了一个facebook应用程序,我有应用程序id和sexret。但是我不知道如何访问oauth\u访问\u令牌。有什么想法吗
我发现了这个>但是,我收到了以下信息:
{
"error": {
"message": "Invalid redirect_uri: \u039f\u03b9 \u03c0\u03b1\u03c1\u03ac\u03bc\u03b5\u03c4\u03c1\u03bf\u03b9 \u03c4\u03b7\u03c2 \u03b5\u03c6\u03b1\u03c1\u03bc\u03bf\u03b3\u03ae\u03c2 \u03b4\u03b5\u03bd \u03b5\u03c0\u03b9\u03c4\u03c1\u03ad\u03c0\u03bf\u03c5\u03bd \u03c4\u03b7 \u03c3\u03c5\u03b3\u03ba\u03b5\u03ba\u03c1\u03b9\u03bc\u03ad\u03bd\u03b7 \u03b4\u03b9\u03b5\u03cd\u03b8\u03c5\u03bd\u03c3\u03b7 URL.",
"type": "OAuthException",
"code": 191
}
}
编辑:我正在从中获取访问令牌。它将用户和应用程序令牌返回给我。因此,我使用以下代码在我的facebook帐户中发布:
import facebook
oauth_access_token = "****"
graph = facebook.GraphAPI(oauth_access_token)
me = "****"
profile = graph.get_object(me)
graph.put_object(me, "feed", message="I am writing on my wall!")
您必须在acces_token和我的账户中放入什么?这里有一个OAuth示例:您有两个选择:
您可以转到并手动获取访问令牌(复制/粘贴),在“获取访问令牌”按钮下(简单但不是永久解决方案),
或者,
你会成功的 为了使用OpenGraph,您需要一个有效的访问令牌。这就是响应的含义 此外,您的通话必须是这样的:
profile = graph.get_object('me') (with quotes)
您还可以检查
[Pythonforfacebook][3]
您可以进入facebook开发者->工具菜单,或者获取您的访问令牌。您必须选择数据和扩展权限才能验证这些操作。并获取访问令牌。
你的代码是
import facebook
import json
token = 'your access token'
graph = facebook.GraphAPI(token)
profile = graph.get_object("me")
graph.put_object("me", "feed", message="I am writing on my wall!") `
ImportError:没有名为google.appengine.ext的模块。我必须安装什么模块??