Files
inspiration-collector/scripts/push_todos.py

18 lines
689 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""Push 4 key todos from the existing library to todo API."""
import requests
todos = [
"为心理黑箱绘制决策流程图,复盘日线震荡却做多的那一单",
"为服务器AI设置即时调用接口支持命令行快捷提问",
"修复Dashboard的初始金额和策略编号显示错误",
"为倒计时建立仪式感在Memos创建告别笔记标签",
]
for text in todos:
r = requests.post("http://127.0.0.1:9001/api/todos",
json={"text": text, "source": "inspiration"}, timeout=5)
print(f" {r.status_code}: {text[:40]}")
r = requests.get("http://127.0.0.1:9001/api/todos", timeout=5)
print(f"\nTotal todos: {len(r.json()['todos'])}")