Skip to content

Instantly share code, notes, and snippets.

@wogong
Created December 13, 2020 17:07
Show Gist options
  • Save wogong/d6e880e191368b502aec95ed84fa1180 to your computer and use it in GitHub Desktop.
Save wogong/d6e880e191368b502aec95ed84fa1180 to your computer and use it in GitHub Desktop.
flomo shell function
#!/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":"'"$*"'"}'
}
@prnake
Copy link

prnake commented Dec 14, 2020

第四行这样写可以返回 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