Skip to content

Instantly share code, notes, and snippets.

@wizardishungry
Last active December 10, 2015 01:38
Show Gist options
  • Save wizardishungry/4360549 to your computer and use it in GitHub Desktop.
Save wizardishungry/4360549 to your computer and use it in GitHub Desktop.
Build a list of ship names
lynx -dump http://en.wikipedia.org/wiki/List_of_United_States_Navy_ships | grep http://en.wikipedia.org/wiki/List_of_Un |sed 's/^.*\. //' | sed 's/#.*$//'| sort | uniq | xargs curl -s |grep '<i>' |sed 's#.*<i>##' | sed 's#</i>.*##' | sort |uniq | grep -v '>' |egrep [A-Z][a-z] | tee america.txtlynx -dump http://en.wikipedia.org/wiki/Category:Lists_of_ships_of_Italy | grep http://en.wikipedia.org/wiki/List_of_ |sed 's/^.*\. //' | sed 's/#.*$//'| sort | uniq | xargs curl -s |grep '<i>' |sed 's#.*<i>##' | sed 's#</i>.*##' | sort |uniq | grep -v '>' |egrep [A-Z][a-z] | tee italy.txt
sh -c 'lynx -dump http://en.wikipedia.org/wiki/Category:Lists_of_ships_of_Sweden ; lynx -dump http://en.wikipedia.org/wiki/Category:Ships_of_the_Finnish_Navy; lynx -dump http://en.wikipedia.org/wiki/Category:Lists_of_ships_of_Sweden ; lynx -dump http://en.wikipedia.org/wiki/Category:Ships_of_the_Royal_Norwegian_Navy; lynx -dump http://en.wikipedia.org/wiki/Category:Ships_of_Denmark' | grep http://en.wikipedia.org/wiki/List_of_ |sed 's/^.*\. //' | sed 's/#.*$//'| sort | uniq | xargs curl -s |grep '<i>' |sed 's#.*<i>##' | sed 's#</i>.*##' | sort |uniq | grep -v '>' |egrep [A-Z][a-z] | tee scandinavia.txt
lynx -dump http://en.wikipedia.org/wiki/List_of_ship_names_of_the_Royal_Navy | grep http://en.wikipedia.org/wiki/List_of_ship_ |sed 's/^.*\. //' | sed 's/#.*$//'| sort | uniq | xargs curl -s |grep '<i>' |sed 's#.*<i>##' | sed 's#</i>.*##' | sort |uniq | grep -v '>' |egrep [A-Z][a-z] | tee britain.txt
lynx -dump http://en.wikipedia.org/wiki/Category:Ships_of_the_People%27s_Liberation_Army_Navy | grep http://en.wikipedia.org/wiki/List_of_ |sed 's/^.*\. //' | sed 's/#.*$//'| sort | uniq | xargs curl -s |grep '<i>' |sed 's#.*<i>##' | sed 's#</i>.*##' | sort |uniq | grep -v '>' |egrep [A-Z][a-z] | tee china.txt
lynx -dump http://en.wikipedia.org/wiki/Category:Lists_of_ships_of_France | grep http://en.wikipedia.org/wiki/List_of_ |sed 's/^.*\. //' | sed 's/#.*$//'| sort | uniq | xargs curl -s |grep '<i>' |sed 's#.*<i>##' | sed 's#</i>.*##' | sort |uniq | grep -v '>' |egrep [A-Z][a-z] | tee france.txt
lynx -dump http://en.wikipedia.org/wiki/List_of_naval_ships_of_Germany | grep http://en.wikipedia.org/wiki/List_of_ |sed 's/^.*\. //' | sed 's/#.*$//'| sort | uniq | xargs curl -s |grep '<i>' |sed 's#.*<i>##' | sed 's#</i>.*##' | sort |uniq | grep -v '>' |egrep [A-Z][a-z] | tee germany.txt
lynx -dump http://en.wikipedia.org/wiki/List_of_ships_of_the_Indian_Navy | grep http://en.wikipedia.org/wiki/List_of_ |sed 's/^.*\. //' | sed 's/#.*$//'| sort | uniq | xargs curl -s |grep '<i>' |sed 's#.*<i>##' | sed 's#</i>.*##' | sort |uniq | grep -v '>' |egrep [A-Z][a-z] | tee india.txt
lynx -dump http://en.wikipedia.org/wiki/Category:Lists_of_ships_of_Italy | grep http://en.wikipedia.org/wiki/List_of_ |sed 's/^.*\. //' | sed 's/#.*$//'| sort | uniq | xargs curl -s |grep '<i>' |sed 's#.*<i>##' | sed 's#</i>.*##' | sort |uniq | grep -v '>' |egrep [A-Z][a-z] | tee italy.txt
lynx -dump http://en.wikipedia.org/wiki/Category:Lists_of_ships_of_Japan | grep http://en.wikipedia.org/wiki/List_of_ |sed 's/^.*\. //' | sed 's/#.*$//'| sort | uniq | xargs curl -s |grep '<i>' |sed 's#.*<i>##' | sed 's#</i>.*##' | sort |uniq | grep -v '>' |egrep [A-Z][a-z] | tee japan.txt
lynx -dump http://en.wikipedia.org/wiki/Category:Lists_of_ships_of_the_Ottoman_Empire | grep http://en.wikipedia.org/wiki/List_of_ |sed 's/^.*\. //' | sed 's/#.*$//'| sort | uniq | xargs curl -s |grep '<i>' |sed 's#.*<i>##' | sed 's#</i>.*##' | sort |uniq | grep -v '>' |egrep [A-Z][a-z] | tee ottoman.txt
lynx -dump http://en.wikipedia.org/wiki/Category:Lists_of_ships_of_Turkey | grep http://en.wikipedia.org/wiki/List_of_ |sed 's/^.*\. //' | sed 's/#.*$//'| sort | uniq | xargs curl -s |grep '<i>' |sed 's#.*<i>##' | sed 's#</i>.*##' | sort |uniq | grep -v '>' |egrep [A-Z][a-z] | tee turkey.txt
cat ottoman.txt >> turkey.txt ; rm ottoman.txt
sh -c 'lynx -dump http://en.wikipedia.org/wiki/Category:Lists_of_ships_of_Russia ; lynx -dump http://en.wikipedia.org/wiki/Category:Naval_ships_of_the_Soviet_Union' | grep http://en.wikipedia.org/wiki/List_of_ |sed 's/^.*\. //' | sed 's/#.*$//'| sort | uniq | xargs curl -s |grep '<i>' |sed 's#.*<i>##' | sed 's#</i>.*##' | sort |uniq | grep -v '>' |egrep [A-Z][a-z] | tee russia.txt
lynx -dump http://en.wikipedia.org/wiki/Category:Lists_of_ships_of_Spain | grep http://en.wikipedia.org/wiki/List_of_ |sed 's/^.*\. //' | sed 's/#.*$//'| sort | uniq | xargs curl -s |grep '<i>' |sed 's#.*<i>##' | sed 's#</i>.*##' | sort |uniq | grep -v '>' |egrep [A-Z][a-z] | tee spain.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment