A Perl program to scrape all texts from Typeracer. Made with quick regular expressions, so no guarantees it will still work if they change their UI.
This program requires the following non-core Perl modules:
- LWP::Simple
- Mozilla::CA
- JSON
#!/usr/bin/env bash | |
case "$1" in | |
id)xinput | grep TouchPad | grep --color=never -Po "(?<=id=)\\d+(?=\\t)" ;; | |
off);& | |
on)xinput set-prop "$($0 id)" "Device Enabled" "$([ "$1" = 'on' ]&&echo 1||echo 0)";; | |
*)echo "Usage: $0 {id|off|on}" | |
esac |
#!/usr/bin/env sh | |
mpc clear | |
curl -s https://somafm.com/channels.xml | grep -Po '((?<=<title><!\[CDATA\[).+?(?=\])|(?<=id=").+?(?="))' | sed 'N;s/\n/ /' | while read -r p; do | |
curl -s "https://somafm.com/$(echo "$p" | grep -Po '^.+?(?= )')130.pls" | grep -Po '(?<=File\d=).+$' | head -n 1 | xargs mpc add; | |
mpc save "Soma FM - $(echo "$p" | grep -Po '(?<= ).+$')" | |
mpc clear | |
done |
#!/usr/bin/env sh | |
curl -s https://somafm.com/channels.xml | grep -Po '((?<=<title><!\[CDATA\[).+?(?=\])|(?<=id=").+?(?="))' | sed 'N;s/\n/ /' | while read -r p; do | |
stationName=$(echo "$(echo "$p" | grep -Po '(?<= ).+$')" | perl -ple '$_=lc; s/[^\w\s]//g; s/ /-/g') | |
echo "Downloading $stationName" | |
curl -s "https://somafm.com/$(echo "$p" | grep -Po '^.+?(?= )')130.pls" > "$stationName.pls" | |
done |
#!/usr/bin/env bash | |
# Syd Lambert 2022, sydlambert.com | |
usage () { | |
cut -c 5- <<EOF | |
Usage: | |
$(basename $0) command [options] | |
A simple script for manual installation of Firefox to the /opt/ directory. |