Created
February 8, 2025 16:55
-
-
Save Brandon-Rozek/f1c7626645ed5e5a8b033fef7183ac25 to your computer and use it in GitHub Desktop.
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/sh | |
# Script that takes you to some random page | |
# on the Internet. | |
# Adapted from: https://lazybea.rs/ils3/ | |
INDIEBLOG=https://indieblog.page/random | |
OOH=https://ooh.directory/random | |
FEEDLE=https:/feedle.world/random | |
OUT=$(mktemp) | |
random_choice=$((RANDOM % 3 + 1)) | |
case $random_choice in | |
1) | |
curl -is ${INDIEBLOG} | rg -w 'location' | sed 's/location: \(.*\)?utm.*/\1/' > ${OUT} | |
;; | |
2) | |
curl -Ls ${OOH}| rg cite | tail -1 | cut -d'"' -f2 > ${OUT} | |
;; | |
3) | |
curl -Ls ${FEEDLE} | rg 'ref=feedle.world' | tail -1 | cut -d '"' -f2 | sed 's/?.*$//' > ${OUT} | |
;; | |
*) | |
echo "Something went wrong" | |
;; | |
esac | |
firefox $(cat ${OUT}) | |
# remove the temp file | |
rm ${OUT} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment