python - 用于发布到 Google+ 的简单 Python 代码

标签 python google-plus

我想从我的应用程序发布到 G+,就像我已经在 Twitter 上编写几行代码一样。我一直在 code.google.com 上查看示例代码,虽然 API 看起来非常强大,但文档使这个简单的任务看起来非常复杂。有人可以提供一个简单的代码片段的指针,该代码片段只需将一些文本发布到我自己的 G+ 帐户吗?

最佳答案

执行此操作的最佳方法是使用交互式帖子。无法以编程方式代表用户编写帖子,但您可以使用预填充的文本和收件人为用户创建共享选项。它呈现为按钮。下面有一个示例。

了解更多信息:https://developers.google.com/+/web/share/interactive

此外,code.google.com 资源已过时。所有更新的样本位于https://github.com/googleplus/ 。具体来说,您可能对 Python 中的 PhotoHunt 服务器感兴趣,以了解 Google+ API 提供的所有功能 ( https://github.com/googleplus/gplus-photohunt-server-python )。

有关 PhotoHunt 中交互式帖子的示例,请查看 https://github.com/googleplus/gplus-photohunt-server-python/blob/master/static/js/controllers.js#L253 .

关于python - 用于发布到 Google+ 的简单 Python 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18019270/

相关文章:

ios - 我应该在导入 GooglePlus.framework 时检查 "Copy items if needed"吗?

internationalization - 在 Google+ 中共享多语言网站

android - Google+ 登录 onConnected 未调用

python - 如何通过单击python标签中的按钮开始录制

Python:如何处理不可订阅的对象?

python - 包 "within"模块

android - 使用 Google Play 服务访问用户电子邮件的 G+ 登录抛出缺少 android.permission.GET_ACCOUNTS

jquery - 使用 jQuery 更改微数据 itemprop 名称值?

Python3 pandas 数据框使用 fillna(方法 ='bfill')和分组依据

python - Keras 和 Python 3.6 : Error when checking input for Sequential model