Created
February 19, 2022 19:30
-
-
Save N-F9/db16d02027654609ab3783a3e1dde534 to your computer and use it in GitHub Desktop.
A super small script to upload a file to anonfiles API.
This file contains 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
#!/usr/bin/env bash | |
content=$(curl -s -F "file=@$1" https://api.anonfiles.com/upload) | |
url=$(jq -r '.data.file.url.short' <<< "$content") | |
name=$(jq -r '.data.file.metadata.name' <<< "$content") | |
size=$(jq -r '.data.file.metadata.size.readable' <<< "$content") | |
echo -e "" | |
echo -e "\e[0;30m┌─\e[0m ${name} \e[0;30m─\e[0m ${size}" | |
echo -e "\e[0;30m└\e[0m \e[1;97m${url}\e[0m" | |
echo -e "\e[0m" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Requires https://stedolan.github.io/jq/ and https://curl.se/