1781780330.jpg
https://webhymn.neocities.org/
#!/bin/bash
EMAIL="email@email.com"
PASSWORD="password@password.com"
scregex="https?:\/\/(www/.)?soundcloud\.com\/([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_-]+)"
if [[ $(termux-clipboard-get) =~ $scregex ]]; then
artist="${BASH_REMATCH[2]}"
track="${BASH_REMATCH[3]}"
useclipboard=$([[ $(termux-dialog confirm -t "Do you want to post: ${artist} - ${track}" | jq -r .text) == "yes" ]] && echo 1)
fi
if [[ ! useclipboard -eq 1 ]]; then
input=$(termux-dialog -t "Enter SoundCloud URL" | jq -r .text)
if [[ ! $input =~ $scregex ]]; then
termux-toast -b "#612121" "Text does not include a SoundCloud URL"
exit 1
fi
artist="${BASH_REMATCH[2]}"
track="${BASH_REMATCH[3]}"
fi
scres=$(curl -sSL "https://soundcloud.com/${artist}/${track}")
imgregex='<meta property="og:image" content="([^"]+)"'
if [[ ! $scres =~ $imgregex ]]; then
termux-toast -b "#612121" "Could not fetch track"
exit 1
fi
imgurl="${BASH_REMATCH[1]}"
imgpath=$(mktemp)
if ! curl -fsSL "$imgurl" -o "$imgpath"; then
rm -f "$imgpath"
termux-toast -b "#612121" "Could not fetch cover art"
exit 1
fi
loginres=$(curl -siS "https://piclog.blue/login.php")
csrfregex='<input type="hidden" name="csrf" value="([^"]+)"'
if [[ ! $loginres =~ $csrfregex ]]; then
rm -f "$imgpath"
termux-toast -b "#612121" "Could not fetch CSRF value needed for login"
exit 1
fi
csrf="${BASH_REMATCH[1]}"
cookieregex='PHPSESSID=([^;]+)'
if [[ ! $(echo "$loginres" | grep ^Set-Cookie) =~ $cookieregex ]]; then
rm -f "$imgpath"
termux-toast -b "#612121" "Could not get piclog anonymous token"
exit 1
fi
sessid="${BASH_REMATCH[1]}"
cookie=$(curl "https://piclog.blue/login.php" -X POST \
-b "PHPSESSID=${sessid}" \
-d "csrf=${csrf}" \
-d "email=${EMAIL}" \
-d "password=${PASSWORD}" \
-sSi | grep ^Set-Cookie)
if [[ ! $cookie =~ $cookieregex ]]; then
rm -f "$imgpath"
termux-toast -b "#612121" "Could not get piclog login token"
exit 1
fi
sessid="${BASH_REMATCH[1]}"
uploadres=$(curl -sS "https://piclog.blue/upload.php" -b "PHPSESSID=${sessid}")
if [[ ! $uploadres =~ $csrfregex ]]; then
rm -f "$imgpath"
termux-toast -b "#612121" "Could not fetch CSRF value needed for upload"
exit 1
fi
csrf="${BASH_REMATCH[1]}"
if ! curl -fsS "https://piclog.blue/upload.php" > /dev/null -X POST \
-H "Cookie: PHPSESSID=${sessid}" \
-F "csrf=${csrf}" \
--form-string "description=<a class=\"is-visitor flash\" target=\"_blank\" href=\"https://soundcloud.com/${artist}/${track}\">${artist} - ${track}</a>" \
-F "image=@${imgpath};type=image/jpeg;filename=$(date +%s).jpg"; then
rm -f "$imgpath"
termux-toast -b "#612121" "Could not upload image"
exit 1
fi
rm -f "$imgpath"
termux-toast -b "#216121" "Posted successfully"
/
1
key
it is valentines day i have no one
renako
copy my swag (right click)
catastic side eye
just a fan of thermodynaics
👍
diy belt
diy tshirt