diff --git a/config/config b/config/config index e70728d5..78af95fe 100644 --- a/config/config +++ b/config/config @@ -409,6 +409,11 @@ scrot_name="neofetch-$(date +%F-%I-%M-%S-${RANDOM}).png" # Possible values: teknik, image_host="teknik" +# Imgur api key +# This is an api key for neofetch, you can sign up for your own +# here: http://api.imgur.com/oauth2/addclient +imgur_client_id="0e8b44d15e9fc95" + # }}} diff --git a/neofetch b/neofetch index eec5e185..3149aa93 100755 --- a/neofetch +++ b/neofetch @@ -2303,9 +2303,15 @@ scrot_upload() { case "$image_host" in "teknik") - image_url="$(curl -sf -F file="@${image_file}" 'https://api.teknik.io/v1/Upload')" + image_url="$(curl -sf -F file="@${image_file}" "https://api.teknik.io/v1/Upload")" image_url="$(awk -F 'url:|,' '{printf $2}' <<< "${image_url//\"}")" ;; + + "imgur") + image_url="$(curl -sH "Authorization: Client-ID $imgur_client_id" -F "image=@${image_file}" "https://api.imgur.com/3/upload")" + image_url="$(awk -F 'id:|,' '{printf $2}' <<< "${image_url//\"}")" + image_url="https://i.imgur.com/${image_url}.png" + ;; esac [ "$image_url" ] && printf "%s\n" "$image_url" diff --git a/poop.png b/poop.png new file mode 100644 index 00000000..ef1d9f28 Binary files /dev/null and b/poop.png differ