Skip to content

Instantly share code, notes, and snippets.

@hansfbaier
Last active June 4, 2024 01:32
Show Gist options
  • Save hansfbaier/5f91068b8f7ad8bf51f3f04e6a5c85e5 to your computer and use it in GitHub Desktop.
Save hansfbaier/5f91068b8f7ad8bf51f3f04e6a5c85e5 to your computer and use it in GitHub Desktop.
Automatically download the TOP 200 Pico8 game cartridges
#!/bin/bash
wget https://nerdyteachers.com/PICO-8/Games/Top200/?d=list -O top200.html
grep bbs top200.html | grep pid | fgrep '/a' | cut -d\" -f6 > urls.txt
grep bbs top200.html | grep pid | fgrep '/a' | cut -d\> -f2 | cut -d\< -f1 > titles.txt
tr -d "\!.':" < titles.txt | tr " " "_" | sed 's/$/.html/' > fnames.txt
exec 6<"fnames.txt"
exec 7<"urls.txt"
while read -r url <&7
do
read -r fname <&6
wget ${url} -O ${fname}
CART=$(grep .p8.png ${fname} | grep bbs | grep href | grep -F 'Cart</a>' | cut -d\" -f4)
wget https://lexaloffle.com${CART} -O $(basename ${fname} .html).p8
done
exec 6<&-
exec 7<&-
echo Cleaning up....
rm *.html
rm *.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment