Spaces:
Sleeping
Sleeping
Download app/utils/note_client.py from Corin1998/PR_IRminiSaaS: direct link, hf CLI and curl.
- Browser
- Download file 492 Bytes
-
https://huggingface.co/spaces/Corin1998/PR_IRminiSaaS/resolve/main/app/utils/note_client.py
- Command line
-
hf download hf://spaces/Corin1998/PR_IRminiSaaS/app/utils/note_client.py
-
curl -L -o note_client.py https://huggingface.co/spaces/Corin1998/PR_IRminiSaaS/resolve/main/app/utils/note_client.py
492 Bytes
| import requests | |
| from app.config import settings | |
| # MVPではZapier/IFTTTなどWebhookにMarkdownを渡す方式を採用 | |
| def post_to_note(title: str, body_md: str): | |
| if not settings.NOTE_WEBHOOK_URL: | |
| # Webhook未設定の場合はスキップ | |
| return {"status": "skipped", "reason": "NOTE_WEBHOOK_URL not set"} | |
| resp = requests.post(settings.NOTE_WEBHOOK_URL, json={"title": title, "content_md": body_md}) | |
| return {"status": resp.status_code, "resp": resp.text[:200]} | |