返回顶部
w

wordpress-oauthWordPress OAuth

Start and complete WordPress.com OAuth and publish posts through the WordPress.com REST API. Use when you need to generate an authorization URL, exchange callback code for an access token, validate token health, or publish draft/published posts to a WordPress.com or Jetpack-connected site.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
170
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

wordpress-oauth

WordPress OAuth 技能

使用此技能运行人工参与的OAuth流程,并通过存储的Bearer令牌发布文章。

技能文件

  • - 脚本:{baseDir}/wpoauthskill.py
  • OAuth状态存储:{baseDir}/oauth_state.json
  • 凭证存储:{baseDir}/credentials.json

该技能将状态和凭证存储在本技能目录的文件中。

命令

使用Python 3运行脚本:

bash
python3 {baseDir}/wpoauthskill.py --help

1) 开始OAuth

bash
python3 {baseDir}/wpoauthskill.py begin-oauth \
--client-id $WPCOMCLIENTID \
--redirect-uri $WPCOMREDIRECTURI \
--scope posts media \
--blog $WPCOM_SITE

返回 auth_url 和 state。打开URL,批准访问,然后复制回调URL。

2) 交换令牌

bash
python3 {baseDir}/wpoauthskill.py exchange-token \
--client-id $WPCOMCLIENTID \
--client-secret $WPCOMCLIENTSECRET \
--redirect-uri $WPCOMREDIRECTURI \
--callback-url https://example/callback?code=...&state=...

验证CSRF state,将授权码交换为令牌,并将凭证写入 {baseDir}/credentials.json。

3) 令牌信息

bash
python3 {baseDir}/wpoauthskill.py token-info --client-id $WPCOMCLIENTID

通过WordPress令牌信息端点检查令牌有效性。

4) 发布文章

bash
python3 {baseDir}/wpoauthskill.py publish-post \
--site $WPCOM_SITE \
--title 我的文章 \
--content

来自OpenClaw的问候

\
--status draft

使用存储的令牌通过 POST /rest/v1.1/sites/$site/posts/new 发布文章。

推荐流程

  1. 1. 运行 begin-oauth。
  2. 在浏览器中打开 auth_url 并授权。
  3. 将回调URL粘贴到 exchange-token。
  4. 可选运行 token-info。
  5. 运行 publish-post。

安全说明

  • - 切勿分享 credentials.json 或客户端密钥。
  • 首次测试文章保持为 draft(草稿)状态。
  • 如果回调状态失败或授权码过期,请重新运行 begin-oauth。

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 wordpress-oauth-1776066739 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 wordpress-oauth-1776066739 技能

通过命令行安装

skillhub install wordpress-oauth-1776066739

下载

⬇ 下载 wordpress-oauth v1.0.0(免费)

文件大小: 4.74 KB | 发布时间: 2026-4-15 15:00

v1.0.0 最新 2026-4-15 15:00
Initial release of wordpress-oauth skill.

- Enables human-in-the-loop OAuth flow for WordPress.com and Jetpack-connected sites.
- Supports generating authorization URLs, exchanging callback codes for access tokens, and validating tokens.
- Allows publishing draft or published posts through the WordPress.com REST API.
- Stores OAuth state and credentials securely within the skill directory.
- Provides CLI commands for each step: begin-oauth, exchange-token, token-info, and publish-post.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部