Name the Fish
This episode is just for fun
Published in
3 min readAug 15, 2014
So I saw this post being shared on Facebook.
Even though I know almost nothing about fish, I can name lots of them. This wikipedia page lists common fish names, so first let’s import it into the irb.
2.1.2 :001 > require 'nokogiri' and require 'open-uri'
=> true
2.1.2 :002 > wiki = Nokogiri::HTML(open('http://en.wikipedia.org/wiki/List_of_common_fish_names'))
=> ....................................
By inspecting that page on the browser, the fish names are the links inside the list in a four-column layout, so let’s get the fish names.
2.1.2 :003 > fish = wiki.css('.column-count-4>ul>li>a').map(&:text)
=> ....................................
Finally, let’s reject the fish with ‘a’ in it.
2.1.2 :004 > fish.reject { |x| x[/a/i] }
=> ["Bent tooth", "Bichir", "Bigeye", "Billfish", "Bitterling", "Blenny", "Blind goby", "Blobfish", "Blowfish", "Blue eye", "Bluefish", "Bluegill", "Blue triggerfish", "Blue whiting", "Bluntnose knifefish", "Bluntnose minnow", "Bonefish", "Bonito", "Bonnetmouth", "Bonytongue", "Bowfin", "Boxfish", "Brill", "Bristlemouth", "Brook trout", "Brown trout", "Bull trout", "Burbot", "Bumblebee goby", "Buri", "Burrowing goby", "Butterflyfish", "Cherubfish", "Chub", "Chubsucker", "Cichlid", "Cisco", "Climbing perch", "Clingfish", "Clown triggerfish", "Cobbler", "Cod", "Cod icefish", "Codlet", "Codling", "Coffinfish", "Coley", "Combfish", "Combtooth blenny", "Common tunny", "Conger eel", "Convict blenny", "Convict cichlid", "Cornetfish", "Cowfish", "Creek chub", "Crestfish", "Crevice kelpfish", "Crocodile icefish", "Cusk-eel", "Cuskfish", "Demoiselle", "Denticle herring", "Desert pupfish", "Dhufish", "Discus", "Dogfish", "Dory", "Driftfish", "Drum", "Duckbill", "Duckbill eel", "Dusky grouper", "Eelblenny", "Eel cod", "Eel-goby", "Eelpout", "Electric eel", "Electric knifefish", "Elver", "Emperor", "Fire Goby", "Filefish", "Fingerfish", "Firefish", "Flier", "Flounder", "Four-eyed fish", "Frogfish", "Fusilier fish", "Ghost fish", "Ghost knifefish", "Ghost pipefish", "Ghoul", "Gibberfish", "Goby", "Golden dojo", "Golden shiner", "Golden trout", "Goldeye", "Goldspotted killifish", "Goosefish", "Gopher rockfish", "Greeneye", "Greenling", "Green spotted puffer", "Grideye", "Grouper", "Grunion", "Grunt", "Grunter", "Grunt sculpin", "Gudgeon", "Gulper eel", "Gulper", "Gunnel", "Guppy", "Herring", "Herring smelt", "Hog sucker", "Hoki", "Horsefish", "Huchen", "Icefish", "Ide", "Inconnu", "Jellynose fish", "Jewelfish", "Jewfish", "John Dory", "Kelp perch", "Kelpfish", "Killifish", "King of the Herrings", "Kingfish", "Knifefish", "Kokopu", "Lefteye flounder", "Lemon sole", "Lenok", "Lightfish", "Lighthousefish", "Lined sole", "Ling", "Ling cod", "Longfin", "Longfin smelt", "Long-finned pike", "Longneck eel", "Longnose sucker", "Lost River sucker", "Luderick", "Lumpsucker", "Lungfish", "Milkfish", "Minnow", "Minnow of the Deep", "Modoc sucker", "Monkfish", "Mooneye", "Moonfish", "Moorish idol", "Morid cod", "Morwong", "Moses sole", "Mosquitofish", "Mouthbrooder", "Mudfish", "Mudminnow", "Mud minnow", "Mudskipper", "Mudsucker", "Mullet", "Mummichog", "Muskellunge", "Needlefish", "New World rivuline", "Nibble Fish", "Noodlefish", "Northern clingfish", "Northern pike", "Nurseryfish", "Oilfish", "Oldwife", "Old World knifefish", "Old World rivuline", "Olive flounder", "Oregon chub", "Owens pupfish", "Pejerrey", "Pencilfish", "Pencilsmelt", "Perch", "Pickerel", "Pigfish", "Pike conger", "Pike eel", "Pike", "Pikeblenny", "Pikeperch", "Pilot fish", "Pineconefish", "Pipefish", "Pleco", "Plunderfish", "Pollyfish", "Pollock", "Pomfret", "Ponyfish", "Poolfish", "Porcupinefish", "Porgy", "Powen", "Pricklefish", "Prowfish", "Pumpkinseed", "Pupfish", "Pygmy sunfish", "Queen triggerfish", "Quillfish", "Redfin perch", "Redfish", "Redhorse sucker", "Redlip blenny", "Redside", "Redtooth triggerfish", "Red velvetfish", "Reedfish", "Reef triggerfish", "Ribbon eel", "Ribbonfish", "Rice eel", "Ricefish", "Righteye flounder", "Rivuline", "Rock cod", "Rockfish", "Rockling", "Rockweed gunnel", "Rohu", "Ronquil", "Roosterfish", "Ropefish", "Rough pomfret", "Rough sculpin", "Roughy", "Round herring", "Round whitefish", "Rudd", "Rudderfish", "Ruffe", "Scorpionfish", "Sculpin", "Scup", "Scythe butterfish", "Shingle Fish", "Shiner", "Shortnose greeneye", "Shortnose sucker", "Shovelnose sturgeon", "Shrimpfish", "Silver driftfish", "Silverside", "Skilfish", "Skipping goby", "Slender snipe eel", "Sleeper", "Slimy sculpin", "Slipmouth", "Smelt", "Smelt-whiting", "Smooth dogfish", "Smoothtongue", "Snipe eel", "Snipefish", "Snoek", "Snook", "Snubnose eel", "Soldierfish", "Sole", "Southern flounder", "Southern smelt", "Speckled trout", "Spiderfish", "Spikefish", "Spinefoot", "Spiny dogfish", "Spiny eel", "Spinyfin", "Splitfin", "Spookfish", "Spotted Climbing perch", "Spotted dogfish", "Springfish", "Squirrelfish", "Stingfish", "Stonefish", "Stoneroller minnow", "Striped burrfish", "Sturgeon", "Sucker", "Summer flounder", "Surfperch", "Surgeonfish", "Sweeper", "Telescopefish", "Tench", "Tenpounder", "Tenuis", "Thornfish", "Three-toothed puffer", "Tigerperch", "Tilefish", "Tommy ruff", "Tompot blenny", "Tonguefish", "Tope", "Topminnow", "Torpedo", "Torrent fish", "Treefish", "Triplefin blenny", "Triplespine", "Tripod fish", "Trout cod", "Trout-perch", "Trumpeter", "Trumpetfish", "Trunkfish", "Tubeblenny", "Tube-eye", "Tube-snout", "Tubeshoulder", "Tui chub", "Turbot", "Turkeyfish", "Two spotted goby", "Unicorn fish", "Velvetfish", "Viperfish", "Weever", "Weeverfish", "Whiff", "Whitefish", "Whiting", "Wobbegong", "Wolf-eel", "Wolffish", "Wolf-herring", "Woody sculpin", "Worm eel", "Wormfish", "Wrymouth", "Yellow-eye mullet", "Yellowfin grouper", "Yellowfin pike", "Yellowfin surgeonfish", "Yellow perch", "Ziege", "Zingel"]
Hmmm… That was easy!