Skip to content

Instantly share code, notes, and snippets.

@FeepingCreature
Created January 2, 2015 18:42
Show Gist options
  • Save FeepingCreature/904a1fee3e7f23f5508b to your computer and use it in GitHub Desktop.
Save FeepingCreature/904a1fee3e7f23f5508b to your computer and use it in GitHub Desktop.
Replace the Factorio list of backers with a list of English towns.
#!/bin/sh
BACKERS=data/core/backers.json
BACKUP=data/core/backers.bak.json
if [ ! -f "$BACKUP" ]
then
echo "Backing up backers.json.."
mv "$BACKERS" "$BACKUP"
fi
echo "Replacing backers.json.."
(
echo "{"
echo " \"backers\":"
echo " ["
wget "http://en.wikipedia.org/w/index.php?title=List_of_towns_in_England&printable=yes" -q -O- |\
grep '^<td><a href' |\
sed -e 's/.*">//' -e 's/<.*//' |\
sed -e "s/.*/ \"\\0\",/" |\
sed '$s/.$//'
echo " ]"
echo "}"
) > "$BACKERS"
echo "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment