如何以编程方式发布到一个喜欢的网页的Facebook feed? [英] How to programmatically publish to a facebook feed for a liked webpage?

查看:94
本文介绍了如何以编程方式发布到一个喜欢的网页的Facebook feed?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力让它上班: https://developers.facebook.com / blog / post / 465 /



步骤1:我正在获得访问令牌:



https:// graph。 facebook.com/oauth/access_token?type=client_cred&client_id=myAppIdclient_secret=myAppSecret



步骤2:我正在发布通过卷曲

  curl -F'access_token = myAccessToken'-F'message = Hello World!'-F'id = http: //example.com'https://graph.facebook.com/feed 

myUrl在说什么 http://example.com



我收到此错误,不能解析为有效的用户ID:

  {error:{message:(#100)http :\ / \\ /示例不能解析为有效的用户ID,type:OAuthException,code:100}} 

步骤3:如果我首先将我的网址发布给linter,并获取其ID:



https://developers.facebook.com/tools/ debug / og / object?q = http%3A%2F%2Fexample.com



https://graph.facebook.com/10150096126766188

  curl  - '''''''''='' > 

然后我得到'用户没有授权应用程序执行此操作'错误:

  {error:{message:(#200)用户尚未授权应用程序执行此操作,type:OAuthException,code:200}} 


解决方案

通过博客发布,这是通过一个应用程序完成的,为此为了工作,应用程序需要扩展权限publish_actions和publish_stream才能发布帖子/评论/喜欢/链接


I'm trying to get this to work: https://developers.facebook.com/blog/post/465/

Step 1: I'm getting an access token:

https://graph.facebook.com/oauth/access_token?type=client_cred&client_id=myAppIdclient_secret=myAppSecret

Step 2: I'm posting via curl

curl -F 'access_token=myAccessToken'  -F 'message=Hello World!'  -F 'id=http://example.com'  https://graph.facebook.com/feed

Where myUrl is say http://example.com

I am getting this error, does not resolve to a valid user ID:

{"error":{"message":"(#100) http:\/\/example does not resolve to a valid user ID","type":"OAuthException","code":100}}

Step 3: If I first post my url to the linter, and get its ID:

https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fexample.com

https://graph.facebook.com/10150096126766188

curl -F 'access_token=myAccessToken'  -F 'message=Hello World!'  -F 'id=10150096126766188'  https://graph.facebook.com/feed

Then I get 'The user hasn't authorized the application to perform this action' error:

{"error":{"message":"(#200) The user hasn't authorized the application to perform this action","type":"OAuthException","code":200}}

解决方案

Going by the blog post this is done via an app, for this to work the app needs the extended permissions 'publish_actions' and 'publish_stream' in order to make posts/comments/likes/links

这篇关于如何以编程方式发布到一个喜欢的网页的Facebook feed?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆