Created
December 13, 2020 17:07
-
-
Save wogong/d6e880e191368b502aec95ed84fa1180 to your computer and use it in GitHub Desktop.
flomo shell function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
fl () { | |
API="https://flomoapp.com/iwh/xxxxxxx/" # substitute with your flomo API | |
curl -s -H "Accept: application/json" -H "Content-type: application/json" -s -X POST $API -d '{"content":"'"$*"'"}' | |
} |
第四行这样写可以返回 msg
内的内容
echo `curl -s -H "Accept: application/json" -H "Content-type: application/json" -s -X POST $API -d '{"content":"'"$*"'"}' | sed 's/[{}"]//g' | sed 's/[,:]/\n/g' | tail -n1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
将文件内容追加到你常用的 shell 配置文件中,
cat flomo.sh >> .bashrc
或者cat flomo.sh >> .zshrc
,更新 API 字段,可以从 flomo 官网获得,链接 https://flomoapp.com/mine?source=incoming_webhook重启终端或者手动重载配置文件
source .bashrc
或source .zshrc
使用:在命令行中通过
fl <notes>
语法,添加笔记到 flomo.