mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
[scripts] Add some of the legacy scripts
This commit is contained in:
parent
aeeda91fe7
commit
bb53d01244
4 changed files with 94 additions and 0 deletions
14
scripts/avifetch
Executable file
14
scripts/avifetch
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
# Script used for keeping the profile pictures up to date on https://nova-vps.ml
|
||||
|
||||
API_BASE="https://discord.com/api/v9"
|
||||
USERS=( "465702500146610176" "186496078273708033" "717352467280691331" )
|
||||
OUTPUT="$HOME/public_web/static/img/"
|
||||
|
||||
for user in "${USERS[@]}"; do
|
||||
data=$(curl -H "Authorization: Bot $DOTFILES_BOT_TOKEN" "$API_BASE/users/$user")
|
||||
avihash=$(jq -r '.avatar' <<< "$data")
|
||||
username=$(jq -r '.username' <<< "$data")
|
||||
wget "https://cdn.discordapp.com/avatars/$user/$avihash.png?size=2048" -O "$OUTPUT/$username.png"
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue