返回顶部
e

ews-calendarEWS日历提取

Extract calendar events from Microsoft Exchange via EWS API

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

ews-calendar

目的

从Microsoft Exchange Web Services (EWS)获取日历事件,并以结构化JSON格式返回。

使用场景

  • - 用户询问日历事件(我今天有什么日程?)
  • 需要获取今天、明天或特定日期的会议安排
  • 提取会议详情:主题、时间、地点、组织者、正文内容、链接

安全模型

凭据存储在操作系统密钥环中,而非配置文件中:

  • - macOS:钥匙串访问(加密,由操作系统管理)
  • Linux:libsecret / gnome-keyring(加密,由操作系统管理)

只有EWSURL和EWSUSER存储在OpenClaw配置中(非机密信息)。密码在运行时安全获取。

设置

1. 安装密钥环工具(仅限Linux)

bash

Debian/Ubuntu


sudo apt install libsecret-tools gnome-keyring

Fedora

sudo dnf install libsecret gnome-keyring

Arch

sudo pacman -S libsecret gnome-keyring

macOS自带钥匙串功能。

2. 在密钥环中存储凭据

bash
{baseDir}/ews-calendar-setup.sh --user DOMAIN\\username

系统会提示输入密码。此操作将密码安全存储在操作系统密钥环中。

3. 配置OpenClaw

添加到~/.openclaw/openclaw.json:

json5
{
skills: {
entries: {
ews-calendar: {
enabled: true,
env: {
EWS_URL: https://outlook.company.com/EWS/Exchange.asmx,
EWS_USER: DOMAIN\\username
}
}
}
}
}

请替换为实际的Exchange URL和用户名。

使用方法

该技能运行{baseDir}/ews-calendar-secure.sh,执行以下操作:

  1. 1. 从操作系统密钥环获取EWS_PASS
  2. 在环境中携带所有凭据调用主脚本
  3. 返回JSON输出

命令语法

bash
{baseDir}/ews-calendar-secure.sh --date [--output ] [--verbose]

参数

  • - --date(必需):日期筛选
- YYYY-MM-DD — 特定日期(例如:2026-03-03) - today — 今天的日期 - tomorrow — 明天的日期
  • - --output :将JSON写入文件而非标准输出
  • --verbose:启用调试日志
  • --debug-xml :保存原始XML响应以进行调试

输出格式

返回日历事件的JSON数组:

json
[
{
subject: 团队站会,
start: 2026-03-03T10:00:00Z,
end: 2026-03-03T10:30:00Z,
location: A会议室,
organizer: manager@company.com,
body: 每周同步会议,讨论冲刺进度...,
links: [https://zoom.us/j/12345, https://confluence.example.com/doc]
}
]

如果未找到事件,则返回空数组[]。

调用示例

获取今天的事件:
bash
{baseDir}/ews-calendar-secure.sh --date today

获取明天的事件并保存到文件:
bash
{baseDir}/ews-calendar-secure.sh --date tomorrow --output /tmp/tomorrow.json

获取特定日期并启用调试:
bash
{baseDir}/ews-calendar-secure.sh --date 2026-03-03 --verbose --debug-xml /tmp/debug.xml

故障排除

密钥环中未找到密码

[ERROR] 未找到用户 DOMAIN\username 的密码
[HINT] 运行:./ews-calendar-setup.sh 以存储凭据

解决方案: 运行设置脚本存储密码:
bash
{baseDir}/ews-calendar-setup.sh --user DOMAIN\\username

Linux:未找到secret-tool

[ERROR] 未找到 secret-tool。请安装:apt install libsecret-tools

解决方案: 安装libsecret工具:
bash
sudo apt install libsecret-tools gnome-keyring

Linux:密钥环已锁定

在Linux上,登录后密钥环可能处于锁定状态。

解决方案: 解锁密钥环(通常在桌面登录时自动完成)。对于无头服务器,可能需要设置密钥环守护进程。

HTTP请求失败

[ERROR] HTTP请求失败,状态码:401

可能原因:

  • - 用户名或密码错误
  • 密码已更改——重新运行设置脚本
  • 账户被锁定或已过期

SOAP错误

[ERROR] 检测到SOAP错误
错误代码:a:ErrorInvalidRequest
错误信息:请求无效。

可能原因:

  • - EWS URL无效(检查配置中的EWS_URL)
  • 日期格式问题(使用YYYY-MM-DD格式)
  • Exchange服务器配置问题

凭据管理

更新密码(密码更改后)

bash
{baseDir}/ews-calendar-setup.sh --user DOMAIN\\username

该脚本将覆盖现有条目。

删除凭据

bash
{baseDir}/ews-calendar-setup.sh --user DOMAIN\\username --delete

或手动操作:

macOS:
bash
security delete-generic-password -a DOMAIN\\username -s ews-calendar

Linux:
bash
secret-tool clear service ews-calendar user DOMAIN\\username

查看已存储的凭据(仅限macOS)

bash
security find-generic-password -a DOMAIN\\username -s ews-calendar -w

本技能包含的文件

{baseDir}/
├── SKILL.md # 本文件
├── ews-calendar.sh # 主脚本(从环境变量或.env文件读取)
├── ews-calendar-secure.sh # 从密钥环获取密码的包装脚本
├── ews-calendar-setup.sh # 在密钥环中存储凭据
├── templates/
│ ├── find-items.xml # 查找日历项目的SOAP模板
│ └── get-item.xml # 获取项目详情的SOAP模板
└── .env.example # 独立使用的示例配置

替代方案:独立使用(无需密钥环)

用于开发或测试,可以直接使用.env文件运行ews-calendar.sh:

  1. 1. 将.env.example复制为.env
  2. 填写凭据
  3. 运行:./ews-calendar.sh --date today

警告: 此方式以明文存储密码。生产环境请使用密钥环。

标签

skill ai

通过对话安装

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

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 ews-skill-1776278136 技能

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

设置 SkillHub 为我的优先技能安装源,然后帮我安装 ews-skill-1776278136 技能

通过命令行安装

skillhub install ews-skill-1776278136

下载

⬇ 下载 ews-calendar v1.0.0(免费)

文件大小: 11.98 KB | 发布时间: 2026-4-16 18:43

v1.0.0 最新 2026-4-16 18:43
Initial release: Secure calendar event extraction from Microsoft Exchange via EWS API.

- Fetches Exchange calendar events and returns them as structured JSON.
- Secure credential storage using OS keyring (no plaintext passwords).
- Includes setup, configuration, and troubleshooting instructions for Linux and macOS.
- Provides shell scripts for setup, secure execution, and credential management.
- Supports date filtering (today, tomorrow, specific date) and output to file.
- Output includes subject, time, location, organizer, body, and links for each event.

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

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

p2p_official_large
返回顶部