1
0
api/tmp/card_add.zsh

23 lines
509 B
Bash
Raw Normal View History

2023-05-21 06:45:18 +00:00
#!/bin/zsh
2023-07-10 03:43:09 +00:00
2023-05-21 06:45:18 +00:00
host=https://api.syui.ai
pass=`cat ~/.config/atr/api_card.json|jq -r .password`
if [ -z "$1" ];then
exit
fi
if [ -z "$2" ];then
exit
fi
if [ -z "$3" ];then
exit
fi
2023-07-01 14:21:48 +00:00
echo username card cp
read
2023-05-24 09:36:44 +00:00
id=`curl -sL "$host/users?itemsPerPage=2000"|jq ".[]|select(.username == \"$1\")"|jq -r .id`
2023-05-21 06:45:18 +00:00
card=$2
cp=$3
2023-07-10 03:43:09 +00:00
s=super
skill=normal
curl -X POST -H "Content-Type: application/json" -d "{\"owner\":$id,\"card\":$card,\"status\":\"$s\",\"cp\":$cp,\"password\":\"$pass\",\"skill\":\"$skill\"}" -sL $host/cards