Files
xianyan/docs/ctc/README.md
Developer 7a6d555e4c chore: 清理临时文件与工作流文档,完善句子来源功能
1. 删除本地临时调试文件、工作流模板、闲置脚本与脑暴记录
2. 新增极简在线记事本API部署文件
3. 修复Flutter端拾光Sheet布局与状态更新问题
4. 完善句子来源后端API与前端导入逻辑
5. 修复macOS平台secure存储插件引用
2026-06-11 04:39:16 +08:00

132 lines
3.3 KiB
Markdown
Executable File
Raw Permalink 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.
# Minimalist-Web-Notepad-API
Minimalist Web Notepad API一款带API的开源轻量级简洁在线笔记本
相信大家都会试过寻找地方来进行临时记录,或者是传输一个文本给其它设备或者他人。
最近我在github发现了一个非常不错的项目[Minimalist Web Notepad][1]。
十分的轻量简洁代码仅5KB用于临时记录与传输文本非常方便简直是极简主义者必备品
我在原项目的基础上加入了API接口日常使用更加方便。
安装教程
--
在index.php文件顶部更改$base_url变量以指向您的站点。
确保允许Web服务器写入_notes目录。
**在Apache上**
您可能需要启用mod_rewrite并.htaccess在站点配置中设置文件。
**在Nginx上**
要启用URL重写请将以下内容放入配置文件中
如果记事本在根目录中:
location / {
rewrite ^/([a-zA-Z0-9_-]+)$ /index.php?note=$1;
}
如果记事本在子目录中:
location ~* ^/notes/([a-zA-Z0-9_-]+)$ {
try_files $uri /notes/index.php?note=$1;
}
API文档
-----
**获取指定笔记文本**
接口地址:/{note}
请求方式get
请求参数raw
返回数据:指定笔记的内容(string)
示例参数:/demo?raw
**新建指定地址笔记并写入文本**
**或修改指定地址笔记文本**
接口地址:/{note}
请求方式get post
请求参数text
返回数据saved(string)
示例参数:/demo?text=test
**新建随机地址笔记并添加文本**
接口地址:/?new
请求方式get post
请求参数text
返回数据新建的网址url(string)
示例参数:/?new&text=test
Demo
----
**通过网站进行文本传输**
![5.png][7]
https://note.166167.xyz
**通过IOS快捷指令进行剪切板同步**
![1.jpg][3]
![2.jpg][4]
**通过Python应用进行Win剪切板同步**
import win32clipboard as w
import win32con
import requests
def copy():
w.OpenClipboard()
data = w.GetClipboardData(win32con.CF_UNICODETEXT)
w.CloseClipboard()
body = {
"text": data,
}
r = requests.post('https://note.166167.xyz/demo', data = body)
print(r.status_code,data)
def paste():
r = requests.get('https://note.166167.xyz/demo?raw')
data = r.text
w.OpenClipboard()
w.SetClipboardData(win32con.CF_UNICODETEXT,data)
w.CloseClipboard()
print(r.status_code,data)
def new():
w.OpenClipboard()
data = w.GetClipboardData(win32con.CF_UNICODETEXT)
w.CloseClipboard()
body = {
"text": data,
}
r = requests.post('https://note.166167.xyz/?new', data = body)
print(r.status_code,data)
[1]: https://github.com/pereorga/minimalist-web-notepad
[3]: https://search.pstatic.net/common?type=origin&src=https://www.mrchung.cn/usr/uploads/2020/04/1156753274.jpg
[4]: https://search.pstatic.net/common?type=origin&src=https://www.mrchung.cn/usr/uploads/2020/04/2992297654.jpg
[5]: https://search.pstatic.net/common?type=origin&src=https://www.mrchung.cn/usr/uploads/2020/04/3170686476.png
[6]: https://search.pstatic.net/common?type=origin&src=https://www.mrchung.cn/usr/uploads/2020/04/1102607478.png
[7]: https://search.pstatic.net/common?type=origin&src=https://www.mrchung.cn/usr/uploads/2020/04/3535009824.png