add hermes skill docs and todo script
This commit is contained in:
16
SKILL.md
Normal file
16
SKILL.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# Microsoft To Do
|
||||
|
||||
When the user asks to add a reminder, todo, task, or Microsoft To Do item, call the n8n webhook.
|
||||
|
||||
The webhook URL is provided by the environment variable `N8N_TODO_WEBHOOK_URL`.
|
||||
|
||||
Input JSON format:
|
||||
|
||||
```json
|
||||
{
|
||||
"title": "续费 OVH",
|
||||
"due": "2026-05-21T15:00:00",
|
||||
"reminder": "2026-05-21T15:00:00"
|
||||
}
|
||||
```
|
||||
Use local Asia/Shanghai time unless the user specifies another timezone.
|
||||
38
add_todo.py
Normal file
38
add_todo.py
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env python3
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import urllib.request
|
||||
|
||||
def main():
|
||||
if len(sys.argv) < 2:
|
||||
print(json.dumps({"ok": False, "error": "missing title"}, ensure_ascii=False))
|
||||
return
|
||||
|
||||
url = os.environ.get("N8N_TODO_WEBHOOK_URL")
|
||||
if not url:
|
||||
print(json.dumps({"ok": False, "error": "N8N_TODO_WEBHOOK_URL not set"}, ensure_ascii=False))
|
||||
return
|
||||
|
||||
title = sys.argv[1]
|
||||
due = sys.argv[2] if len(sys.argv) > 2 else ""
|
||||
reminder = sys.argv[3] if len(sys.argv) > 3 else due
|
||||
|
||||
payload = {
|
||||
"title": title,
|
||||
"due": due,
|
||||
"reminder": reminder,
|
||||
}
|
||||
|
||||
req = urllib.request.Request(
|
||||
url,
|
||||
data=json.dumps(payload).encode("utf-8"),
|
||||
headers={"Content-Type": "application/json"},
|
||||
method="POST",
|
||||
)
|
||||
|
||||
with urllib.request.urlopen(req, timeout=20) as resp:
|
||||
print(resp.read().decode("utf-8", "ignore"))
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user