Last active
June 4, 2024 01:32
-
-
Save hansfbaier/5f91068b8f7ad8bf51f3f04e6a5c85e5 to your computer and use it in GitHub Desktop.
Automatically download the TOP 200 Pico8 game cartridges
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
#!/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