From 05a94833d520285e9fb47e2f85f1bfb2cc0fbbca Mon Sep 17 00:00:00 2001 From: C J Silverio Date: Wed, 19 Oct 2022 16:30:04 -0700 Subject: [PATCH] Nuke a never-used easter egg. --- SEEDS | 1 + WHALES | 142 ------------------------------------------------ src/bin/SEED.rs | 3 +- src/loudbot.rs | 19 ------- 4 files changed, 2 insertions(+), 163 deletions(-) delete mode 100644 WHALES diff --git a/SEEDS b/SEEDS index d07299e..8e5f42f 100644 --- a/SEEDS +++ b/SEEDS @@ -21,6 +21,7 @@ HAVE NO FEAR LOUDBOT IS HERE HEY, YOU. YOU'RE FINALLY AWAKE. YOU WERE TRYING TO CROSS THE BORDER, RIGHT? WALKED RIGHT INTO THAT IMPERIAL AMBUSH, SAME AS US, AND THAT THIEF OVER THERE. HUGE MISTAKE I GOT TO THINKING… MAYBE I’M THE DRAGONBORN AND I JUST DON’T KNOW IT YET! +I JUST LIKE SERVALS, OKAY? I KNOW I'VE MADE SOME VERY POOR DECISIONS RECENTLY, BUT I CAN GIVE YOU MY COMPLETE ASSURANCE THAT MY WORK WILL BE BACK TO NORMAL. I'VE STILL GOT THE GREATEST ENTHUSIASM AND CONFIDENCE IN THE MISSION. I LIKE YOUR OPTIMISM I USED TO BE AN ADVENTURER LIKE YOU, THEN I TOOK AN ARROW IN THE KNEE. diff --git a/WHALES b/WHALES deleted file mode 100644 index 3ba31f2..0000000 --- a/WHALES +++ /dev/null @@ -1,142 +0,0 @@ -LOOMINGS -THE CARPET-BAG -THE SPOUTER-INN -THE COUNTERPANE -BREAKFAST -THE STREET -THE CHAPEL -THE PULPIT -THE SERMON -A BOSOM FRIEND -NIGHTGOWN -BIOGRAPHICAL -WHEELBARROW -NANTUCKET -CHOWDER -THE SHIP -THE RAMADAN -HIS MARK -THE PROPHET -ALL ASTIR -GOING ABOARD -MERRY CHRISTMAS -THE LEE SHORE -THE ADVOCATE -POSTSCRIPT -KNIGHTS AND SQUIRES -AHAB -ENTER AHAB; TO HIM, STUBB -THE PIPE -QUEEN MAB -CETOLOGY -THE SPECKSNYDER -THE CABIN-TABLE -THE MAST-HEAD -THE QUARTER-DECK -SUNSET -DUSK -FIRST NIGHT-WATCH -MIDNIGHT, FORECASTLE -MOBY DICK -THE WHITENESS OF THE WHALE -HARK! -THE CHART -THE AFFIDAVIT -SURMISES -THE MAT-MAKER -THE FIRST LOWERING -THE HYENA -AHAB’S BOAT AND CREW -THE SPIRIT-SPOUT -THE ALBATROSS -THE GAM -THE TOWN-HO’S STORY -OF THE MONSTROUS PICTURES OF WHALES -OF THE LESS ERRONEOUS PICTURES OF WHALES, AND THE TRUE PICTURES OF WHALING SCENES -OF WHALES IN PAINT; IN TEETH; IN WOOD; IN SHEET-IRON; IN STONE; IN MOUNTAINS; IN STARS -BRIT -SQUID -THE LINE -STUBB KILLS A WHALE -THE DART -THE CROTCH -STUBB’S SUPPER -THE WHALE AS A DISH -THE SHARK MASSACRE -CUTTING IN -THE BLANKET -THE FUNERAL -THE SPHYNX -THE JEROBOAM’S STORY -THE MONKEY-ROPE -STUBB AND FLASK KILL A RIGHT WHALE; AND THEN HAVE A TALK OVER HIM -THE SPERM WHALE’S HEAD—CONTRASTED VIEW -THE RIGHT WHALE’S HEAD—CONTRASTED VIEW -THE BATTERING-RAM -THE GREAT HEIDELBURGH TUN -CISTERN AND BUCKETS -THE PRAIRIE -THE NUT -THE PEQUOD MEETS THE VIRGIN -THE HONOR AND GLORY OF WHALING -JONAH HISTORICALLY REGARDED -PITCHPOLING -THE FOUNTAIN -THE TAIL -THE GRAND ARMADA -SCHOOLS AND SCHOOLMASTERS -FAST-FISH AND LOOSE-FISH -HEADS OR TAILS -THE PEQUOD MEETS THE ROSE-BUD -AMBERGRIS -THE CASTAWAY -A SQUEEZE OF THE HAND -THE CASSOCK -THE TRY-WORKS -THE LAMP -STOWING DOWN AND CLEARING UP -THE DOUBLOON -LEG AND ARM -THE DECANTER -A BOWER IN THE ARSACIDES -MEASUREMENT OF THE WHALE’S SKELETON -THE FOSSIL WHALE -DOES THE WHALE’S MAGNITUDE DIMINISH?—WILL HE PERISH? -AHAB’S LEG -THE CARPENTER -AHAB AND THE CARPENTER -AHAB AND STARBUCK IN THE CABIN -QUEEQUEG IN HIS COFFIN -THE PACIFIC -THE BLACKSMITH -THE FORGE -THE GILDER -THE PEQUOD MEETS THE BACHELOR -THE DYING WHALE -THE WHALE WATCH -THE QUADRANT -THE CANDLES -THE DECK TOWARDS THE END OF THE FIRST NIGHT WATCH -MIDNIGHT - THE FORECASTLE BULWARKS -MIDNIGHT ALOFT - THUNDER AND LIGHTNING -THE MUSKET -THE NEEDLE -THE LOG AND LINE -THE LIFE-BUOY -THE DECK -THE PEQUOD MEETS THE RACHEL -THE CABIN -THE HAT -THE PEQUOD MEETS THE DELIGHT -THE SYMPHONY -THE CHASE—FIRST DAY -THE CHASE—SECOND DAY -THE CHASE—THIRD DAY -TOWARDS THEE I ROLL, THOU ALL-DESTROYING BUT UNCONQUERING WHALE; TO THE LAST I GRAPPLE WITH THEE; FROM HELL'S HEART I STAB AT THEE; FOR HATE'S SAKE I SPIT MY LAST BREATH AT THEE. -IT IS NOT DOWN ON ANY MAP; TRUE PLACES NEVER ARE. -ALL MY MEANS ARE SANE, MY MOTIVE AND MY OBJECT MAD. -YES, AS EVERYONE KNOWS, MEDITATION AND WATER ARE WEDDED FOR EVER. -AS FOR ME, I AM TORMENTED WITH AN EVERLASTING ITCH FOR THINGS REMOTE. I LOVE TO SAIL FORBIDDEN SEAS, AND LAND ON BARBAROUS COASTS. -CALL ME ISHMAEL. -SOME YEARS AGO—NEVER MIND HOW LONG PRECISELY—HAVING LITTLE OR NO MONEY IN MY PURSE, AND NOTHING PARTICULAR TO INTEREST ME ON SHORE, I THOUGHT I WOULD SAIL ABOUT A LITTLE AND SEE THE WATERY PART OF THE WORLD. -IT IS A WAY I HAVE OF DRIVING OFF THE SPLEEN AND REGULATING THE CIRCULATION. diff --git a/src/bin/SEED.rs b/src/bin/SEED.rs index 92b90a8..2076b7a 100644 --- a/src/bin/SEED.rs +++ b/src/bin/SEED.rs @@ -1,7 +1,7 @@ #![allow(non_snake_case)] //! SEED fills out redis with data for all the special features and then //! adds shouts from files listed as arguments. -//! Example usage: `SEED SEEDS WHALES custom.txt` +//! Example usage: `SEED SEEDS custom.txt` //! All seed files must be newline-delimited text files. use anyhow::{Context, Result}; use dotenv::dotenv; @@ -72,7 +72,6 @@ fn main() -> Result<()> { seed_from_file(&mut rcon, "STAR_FIGHTING", &swkey, true)?; seed_from_file(&mut rcon, "SHIPS", &shipkey, true)?; seed_from_file(&mut rcon, "MALCOLM", &malckey, true)?; - seed_from_file(&mut rcon, "WHALES", &format!("{}:WHALES", redis_prefix), true)?; for f in std::env::args().skip(1) { seed_from_file(&mut rcon, &f, &yellkey, false)?; diff --git a/src/loudbot.rs b/src/loudbot.rs index 7b7519e..536e3f9 100644 --- a/src/loudbot.rs +++ b/src/loudbot.rs @@ -23,8 +23,6 @@ const SHIPS: &str = "LB:SHIPS"; const CATS: &str = "LB:CAT"; /// Redis key for a set of URLs for GIFs of Malcolm Tucker. const MALCOLM: &str = "LB:MALC"; -/// Redis key for set of Moby Dick chapter titles. -const WHALES: &str = "LB:WHALES"; /// Redis key for count of times yelled const COUNT: &str = "LB:COUNT"; @@ -187,8 +185,6 @@ pub struct Classifier { malc: Regex, /// "Fuckity bye" gets a special from Malcolm Tucker. fuckity: Regex, - /// The Moby Dick easter egg pattern. - whales: Regex, } impl Classifier { @@ -203,7 +199,6 @@ impl Classifier { ship: Regex::new(r"(?i)\bSHIP ?NAME\b").unwrap(), ignore: Regex::new(IGNORE).unwrap(), sw: Regex::new(SW).unwrap(), - whales: Regex::new(r"(?i)\bMOBY +DICK\b").unwrap(), swears: regex::RegexSet::new(&[ r"(?i).*FUCK.*", r"(?i)\bCUNT\b", @@ -226,9 +221,6 @@ impl Classifier { Retort::Random(CATS.to_string()) } else if self.ship.is_match(text) { Retort::Random(SHIPS.to_string()) - } else if self.whales.is_match(text) { - log::info!("moby dick triggered"); - Retort::Random(WHALES.to_string()) } else if self.report.is_match(text) { Retort::Report } else if self.intro.is_match(text) { @@ -303,17 +295,6 @@ mod tests { assert!(patt.is_match("third moon of Endor")); } - #[test] - fn whale_easter_egg() { - let detector = Classifier::new(0); - - assert!(detector.whales.is_match("moby dick")); - assert!(detector.whales.is_match("herman melville wrote moby dick which is about whales and stuff")); - assert!(detector.whales.is_match("moby dick")); - assert!(detector.whales.is_match("MOBY DICK")); - assert!(!detector.whales.is_match("MOBY DICKLESS")); - } - #[test] fn scunthorpe_problem() { let detector = Classifier::new(100);