Skip to content

Instantly share code, notes, and snippets.

@GitaiQAQ
Last active December 29, 2017 04:00
Show Gist options
  • Select an option

  • Save GitaiQAQ/99d84a821166076a3370b7b9f33284ce to your computer and use it in GitHub Desktop.

Select an option

Save GitaiQAQ/99d84a821166076a3370b7b9f33284ce to your computer and use it in GitHub Desktop.
上传图片到 SM.MS 的脚本
#!bin/bash
# 上传图片到 SM.MS 的脚本
# ./sm.sh image1.png image2.png
jsonRet=""
for f in "$@"
do
ref=$(curl --progress-bar -F smfile=@$f https://sm.ms/api/upload | jq '"[\(.data.filename)](\(.data.url))"')
ref=${ref//\"/}
jsonRet=${jsonRet}$ref"\n"
done
echo -e $jsonRet | xsel -b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment