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.
使用此技能运行人工参与的OAuth流程,并通过存储的Bearer令牌发布文章。
该技能将状态和凭证存储在本技能目录的文件中。
使用Python 3运行脚本:
bash
python3 {baseDir}/wpoauthskill.py --help
bash
python3 {baseDir}/wpoauthskill.py begin-oauth \
--client-id $WPCOMCLIENTID \
--redirect-uri $WPCOMREDIRECTURI \
--scope posts media \
--blog $WPCOM_SITE
返回 auth_url 和 state。打开URL,批准访问,然后复制回调URL。
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。
bash
python3 {baseDir}/wpoauthskill.py token-info --client-id $WPCOMCLIENTID
通过WordPress令牌信息端点检查令牌有效性。
bash
python3 {baseDir}/wpoauthskill.py publish-post \
--site $WPCOM_SITE \
--title 我的文章 \
--content
来自OpenClaw的问候
\使用存储的令牌通过 POST /rest/v1.1/sites/$site/posts/new 发布文章。
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 wordpress-oauth-1776066739 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 wordpress-oauth-1776066739 技能
skillhub install wordpress-oauth-1776066739
文件大小: 4.74 KB | 发布时间: 2026-4-15 15:00