Last active
August 31, 2022 14:24
-
-
Save thingsiplay/c057daf97e3b7fc2031a9344552444e4 to your computer and use it in GitHub Desktop.
Print current GAME ROW.
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
#!/usr/bin/bash | |
# Print current GAME ROW. | |
# https://www.reddit.com/r/gamerow/comments/u9587m/rgamerow_lounge/ | |
link="https://thingsiplay.eu.pythonanywhere.com/game-random-of-the-week" | |
if [ $# -eq 0 ] | |
then | |
curl -s "$link" \ | |
| sed 's/<[^>]\+>//g' \ | |
| sed -E '/^$|Discussion/d' \ | |
| sed -E 's/: html,.+|Week://g' \ | |
| sed -z 's/\n//' | |
else | |
if [ "$1" == "--help" ] | |
then | |
echo "Usage:" | |
echo " $(basename "$0") [system] [head]" | |
echo "" | |
echo "Examples:" | |
echo " $(basename "$0")" | |
echo " $(basename "$0") nes" | |
echo " $(basename "$0") nes name" | |
elif [ $# -eq 1 ] | |
then | |
curl -f -s "$link/$1" | |
else | |
curl -f -s "$link/$1" | awk -F': ' "/^$2/{print \$2}" | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment