返回顶部
w

wordpress-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
安全检测
已通过
154
下载量
0
收藏
概述
安装方式
版本历史

wordpress-oauth

# WordPress OAuth Skill Use this skill to run a human-in-the-loop OAuth flow and publish posts with a stored bearer token. ## Files in this skill - Script: `{baseDir}/wp_oauth_skill.py` - OAuth state store: `{baseDir}/oauth_state.json` - Credential store: `{baseDir}/credentials.json` This skill stores state and credentials in files inside this skill directory. ## Commands Run the script with Python 3: ```bash python3 {baseDir}/wp_oauth_skill.py --help ``` ### 1) Begin OAuth ```bash python3 {baseDir}/wp_oauth_skill.py begin-oauth \ --client-id "$WPCOM_CLIENT_ID" \ --redirect-uri "$WPCOM_REDIRECT_URI" \ --scope "posts media" \ --blog "$WPCOM_SITE" ``` Returns `auth_url` and `state`. Open the URL, approve access, then copy the callback URL. ### 2) Exchange Token ```bash python3 {baseDir}/wp_oauth_skill.py exchange-token \ --client-id "$WPCOM_CLIENT_ID" \ --client-secret "$WPCOM_CLIENT_SECRET" \ --redirect-uri "$WPCOM_REDIRECT_URI" \ --callback-url "https://example/callback?code=...&state=..." ``` Validates CSRF `state`, exchanges code for token, and writes credentials to `{baseDir}/credentials.json`. ### 3) Token Info ```bash python3 {baseDir}/wp_oauth_skill.py token-info --client-id "$WPCOM_CLIENT_ID" ``` Checks token validity with WordPress token-info endpoint. ### 4) Publish Post ```bash python3 {baseDir}/wp_oauth_skill.py publish-post \ --site "$WPCOM_SITE" \ --title "My post" \ --content "<p>Hello from OpenClaw</p>" \ --status draft ``` Publishes a post via `POST /rest/v1.1/sites/$site/posts/new` using the stored token. ## Recommended flow 1. Run `begin-oauth`. 2. Open `auth_url` in browser and authorize. 3. Paste callback URL into `exchange-token`. 4. Optionally run `token-info`. 5. Run `publish-post`. ## Security notes - Never share `credentials.json` or client secrets. - Keep first test posts as `draft`. - Re-run `begin-oauth` if callback state fails or auth code expires.

标签

skill ai

通过对话安装

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

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

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

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

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

通过命令行安装

skillhub install wordpress-oauth-1776066739

下载 Zip 包

⬇ 下载 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
返回顶部