Corin1998 commited on
Commit
bd59e2c
·
verified ·
1 Parent(s): f95efe8

Update app/utils/note_client.py

Browse files
Files changed (1) hide show
  1. app/utils/note_client.py +3 -7
app/utils/note_client.py CHANGED
@@ -1,14 +1,10 @@
1
  import requests
2
  from app.config import settings
3
 
4
-
5
- # noteは一般向けの安定APIがないため、MVPではZapier/IFTTT等のWebhookにMarkdownを渡す方法を推奨。
6
- # 将来的に公式/提携API利用へ差し替え可能なインターフェイスにしておく。
7
-
8
-
9
  def post_to_note(title: str, body_md: str):
10
  if not settings.NOTE_WEBHOOK_URL:
11
- # Webhook未設定の場合は保存のみ(呼び出し側で案内)
12
  return {"status": "skipped", "reason": "NOTE_WEBHOOK_URL not set"}
13
  resp = requests.post(settings.NOTE_WEBHOOK_URL, json={"title": title, "content_md": body_md})
14
- return {"status": resp.status_code, "resp": resp.text[:200]}
 
1
  import requests
2
  from app.config import settings
3
 
4
+ # MVPではZapier/IFTTTなどWebhookにMarkdownを渡す方式を採用
 
 
 
 
5
  def post_to_note(title: str, body_md: str):
6
  if not settings.NOTE_WEBHOOK_URL:
7
+ # Webhook未設定の場合はスキップ
8
  return {"status": "skipped", "reason": "NOTE_WEBHOOK_URL not set"}
9
  resp = requests.post(settings.NOTE_WEBHOOK_URL, json={"title": title, "content_md": body_md})
10
+ return {"status": resp.status_code, "resp": resp.text[:200]}