您如何使用 Python 与 Facebook Graph API 分享其他人的 post?
How can you share someone else's post with the Facebook Graph API using Python?
我想分享 post 我没有 API 访问权限的页面。我只想使用这些 post 的 link 字面意思 'share' post 就好像我在 Facebook 中手动 'shared' 它一样。
我在这方面找到的文档很少。
下面的代码 post 将 link 作为文本 post。我不知道是否可以输入 'message' 以外的其他选项。
import facebook
graph = facebook.GraphAPI(access_token='EAEAEAEAEAEAEAEAEEAEAE___FAKE_ACCESS_TOKEN____AEAEAEAEAEAEAEAEEA', version='3.1')
graph.put_object("me", "feed", message="https://www.facebook.com/tacobell/videos/252550596159857")
(Facebook Graph API 允许您 post 到您使用软件控制的 Facebook 页面,只是为了非常清楚。)
我自己想出来了。如果您执行与 OP 相同的所有操作,但将 'message' 更改为 link 并粘贴 Facebook post 的 link,它将发布到页面,就好像它是 'shared' 在 Facebook 上。
graph.put_object("me", "feed", link="https://www.facebook.com/tacobell/videos/252550596159857")
我想分享 post 我没有 API 访问权限的页面。我只想使用这些 post 的 link 字面意思 'share' post 就好像我在 Facebook 中手动 'shared' 它一样。
我在这方面找到的文档很少。
下面的代码 post 将 link 作为文本 post。我不知道是否可以输入 'message' 以外的其他选项。
import facebook
graph = facebook.GraphAPI(access_token='EAEAEAEAEAEAEAEAEEAEAE___FAKE_ACCESS_TOKEN____AEAEAEAEAEAEAEAEEA', version='3.1')
graph.put_object("me", "feed", message="https://www.facebook.com/tacobell/videos/252550596159857")
(Facebook Graph API 允许您 post 到您使用软件控制的 Facebook 页面,只是为了非常清楚。)
我自己想出来了。如果您执行与 OP 相同的所有操作,但将 'message' 更改为 link 并粘贴 Facebook post 的 link,它将发布到页面,就好像它是 'shared' 在 Facebook 上。
graph.put_object("me", "feed", link="https://www.facebook.com/tacobell/videos/252550596159857")