├── .github └── workflows │ └── cf-deploy.yml ├── .gitignore ├── .prettierrc ├── LICENSE ├── README.md ├── package.json ├── src ├── data.json ├── index.js └── util.js ├── wrangler.toml └── yarn.lock /.github/workflows/cf-deploy.yml: -------------------------------------------------------------------------------- 1 | name: "Deploy to Cloudflare Workers" 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | deploy: 10 | runs-on: ubuntu-latest 11 | name: Deploy 12 | steps: 13 | - uses: actions/checkout@master 14 | - name: Publish 15 | uses: cloudflare/wrangler-action@1.2.0 16 | with: 17 | apiToken: ${{ secrets.CF_API_TOKEN }} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /dist 3 | **/*.rs.bk 4 | Cargo.lock 5 | bin/ 6 | pkg/ 7 | wasm-pack.log 8 | worker/ 9 | node_modules/ 10 | .cargo-ok -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": false, 3 | "semi": true, 4 | "trailingComma": "all", 5 | "tabWidth": 4, 6 | "printWidth": 80 7 | } 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020 md678685 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Spigot Drama Generator 2 | 3 | This generates drama around the Spigot community. 4 | 5 | Inspired by (and heavily borrows from) [asiekierka's Minecraft Drama Generator](https://github.com/asiekierka/MinecraftDramaGenerator). 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "spigot-drama-generator", 3 | "version": "1.0.0", 4 | "description": "Generates drama around the Spigot community", 5 | "main": "src/index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "format": "prettier --write '**/*.{js,css,json,md}'", 9 | "dev": "wrangler dev" 10 | }, 11 | "author": "md678685 <1917406+md678685@users.noreply.github.com>", 12 | "license": "MIT", 13 | "devDependencies": { 14 | "prettier": "^1.18.2" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/data.json: -------------------------------------------------------------------------------- 1 | { 2 | "combinations": { 3 | "people": [ 4 | "md_5", 5 | "Choco", 6 | "Aikar", 7 | "kashike", 8 | "electroniccat", 9 | "Z750", 10 | "LaxWasHere", 11 | "wizjany", 12 | "Me4502", 13 | "mbaxter", 14 | "Amaranth", 15 | "Tux", 16 | "andrewkm", 17 | "KHobbits", 18 | "ElgarL", 19 | "mdcfe", 20 | "Trent", 21 | "SupaHam", 22 | "pop4959", 23 | "JRoy", 24 | "zml", 25 | "Luck", 26 | "Proximyst", 27 | "Glare", 28 | "simpleauthority", 29 | "garbagemule", 30 | "DenWav", 31 | "Songoda", 32 | "kangarko", 33 | "MiniDigger", 34 | "libraryaddict", 35 | "Puremin0rez", 36 | "Intelli", 37 | "kennytv", 38 | "mikroskeem", 39 | "nossr50", 40 | "BtoBastian", 41 | "Proxymist", 42 | "Citymonstret", 43 | "Turbotailz", 44 | "Larry", 45 | "Phoenix616", 46 | "Spottedleaf", 47 | "stefvanschie", 48 | "Byteflux", 49 | "Camm", 50 | "BillyGalbreath", 51 | "vk2gpz", 52 | "bloodmc", 53 | "gabizou", 54 | "TheBusyBiscuit", 55 | "octylFractal", 56 | "aurora", 57 | "MrIvanPlays", 58 | "Chew", 59 | "Vicarious", 60 | "extended_clip", 61 | "Funnycube", 62 | "Broccolai", 63 | "aberdeener", 64 | "Inscrutable", 65 | "dualspiral", 66 | "modmuss50", 67 | "i509VCB", 68 | "jpenilla", 69 | "ocelotpotpie", 70 | "Prof_Bloodstone", 71 | "NotMyFault", 72 | "Emily", 73 | "rymiel", 74 | "Kezz", 75 | "Michael", 76 | "EterNity", 77 | "MachineMaker", 78 | "LichtHund" 79 | ], 80 | "sites": [ 81 | "SpigotMC Forums", 82 | "Minecraft Forums", 83 | "Reddit", 84 | "/r/admincraft", 85 | "PaperMC Discord", 86 | "GitHub", 87 | "SpigotMC JIRA", 88 | "IRC", 89 | "SpigotMC Resources", 90 | "Patreon", 91 | "wiki.vg/Protocol", 92 | "Twitch", 93 | "MCMarket", 94 | "Songoda.com", 95 | "MineAcademy", 96 | "Hangar", 97 | "BukkitDev", 98 | "Ore", 99 | "bStats", 100 | "SpigotMC IRC", 101 | "EsperNet", 102 | "MOSS Discord", 103 | "EssentialsX issue tracker", 104 | "Sponge Forums", 105 | "SpigotMC Discord", 106 | "Incendo", 107 | "Syscraft", 108 | "HelpChat Discord", 109 | "the entire Fabric modding scene", 110 | "the Minecraft community" 111 | ], 112 | "things": [ 113 | "Paper", 114 | "Spigot", 115 | "Bungeecord", 116 | "CraftBukkit", 117 | "Fukkit", 118 | "Velocity", 119 | "EssentialsX", 120 | "GroupManager", 121 | "LuckPerms", 122 | "PermissionsEx v1", 123 | "Vault", 124 | "VanishNoPacket", 125 | "FactionsUUID", 126 | "Waterfall", 127 | "Tuinity", 128 | "Purpur", 129 | "LWC", 130 | "TreeAssist", 131 | "ChatControl", 132 | "ProtocolLib", 133 | "ViaVersion", 134 | "ViaRewind", 135 | "ViaBackwards", 136 | "ProtocolSupport", 137 | "Dynmap", 138 | "Fabric", 139 | "WorldEdit", 140 | "WorldGuard", 141 | "CraftBook", 142 | "Sponge", 143 | "SpongeForge", 144 | "SpongeVanilla", 145 | "Forge", 146 | "Mojang", 147 | "open-source plugins", 148 | "closed-source plugins", 149 | "CMI", 150 | "Genders", 151 | "EpicGenders", 152 | "MobArena", 153 | "Hangar", 154 | "the Bukkit API", 155 | "TruAntiLag", 156 | "MiniMessage", 157 | "MineDown", 158 | "mcMMO", 159 | "Lib's Disguises", 160 | "CoreProtect", 161 | "Prism", 162 | "LogBlock", 163 | "NuVotifier", 164 | "Votifier", 165 | "Ore", 166 | "bStats", 167 | "kyori/text", 168 | "kyori/adventure", 169 | "RotatoR", 170 | "LuckPerms Web Editor", 171 | "Chester", 172 | "EngineHub", 173 | "ChestShop", 174 | "Nucleus", 175 | "Skript", 176 | "Denizen", 177 | "Helper", 178 | "spark", 179 | "Towny", 180 | "FastAsyncWorldEdit", 181 | "PlotSquared", 182 | "Multiverse", 183 | "GriefPrevention", 184 | "GriefDefender", 185 | "Travertine", 186 | "ACF", 187 | "Brigadier", 188 | "Citizens", 189 | "RedisBungee", 190 | "Flamecord", 191 | "Slimefun", 192 | "free plugins", 193 | "premium plugins", 194 | "Kotlin", 195 | "Scala", 196 | "Groovy", 197 | "Syscraft", 198 | "Yatopia", 199 | "BKCommonLib", 200 | "Krypton", 201 | "Crossstitch", 202 | "Hyperverse", 203 | "Privacy", 204 | "PlaceholderAPI", 205 | "VanillaGradle", 206 | "DataFixerUpper", 207 | "Airplane", 208 | "Quilt", 209 | "LazyDFU", 210 | "NamelessMC", 211 | "Folia" 212 | ], 213 | "servers": [ 214 | "Empire Minecraft", 215 | "Mineplex", 216 | "2b2t", 217 | "SpigotCraft", 218 | "EcoCityCraft", 219 | "Minehut", 220 | "Hypixel", 221 | "Dyescape", 222 | "Mineteria", 223 | "CubeCraft", 224 | "The Hive", 225 | "Realms", 226 | "Origin Realms", 227 | "Mineclub", 228 | "AusCraft", 229 | "Sponge Community Server" 230 | ], 231 | "function": [ 232 | "1.8 support", 233 | "mod support", 234 | "1.7.10 support", 235 | "1.8 combat", 236 | "chat formatting", 237 | "Velocity support", 238 | "Bungeecord support", 239 | "Sponge support", 240 | "Forge compatibility", 241 | "async teleportation", 242 | "/kittycannon", 243 | "/beezooka", 244 | "Paper exclusivity", 245 | "PaperLib.suggestPaper()", 246 | "dupe fixes", 247 | "economy", 248 | "RGB support", 249 | "realism", 250 | "new player capes", 251 | "more drama", 252 | "less drama", 253 | "drama generation commands", 254 | "custom enchantments", 255 | "overpowered items", 256 | "underpowered items", 257 | "achievements", 258 | "quests", 259 | "more annoying worldgen", 260 | "legacy color codes", 261 | "Spigot bugs", 262 | "datapacks", 263 | "automated wizjany pinging", 264 | "improved API", 265 | "GPL compliance", 266 | "overpowered commands", 267 | "underpowered commands", 268 | "anti-cheat", 269 | "mixins", 270 | "patches", 271 | "MCP mappings", 272 | "Yarn mappings", 273 | "Mojang mappings", 274 | "Brigadier support", 275 | "hover events", 276 | "click events", 277 | "the MIT license", 278 | "Kotlin support", 279 | "Scala support", 280 | "Groovy support", 281 | "automatic library downloading", 282 | "bytecode rewrites", 283 | "reflection-based Spigot bug workarounds", 284 | "Bukkit support", 285 | "DataFixerUpper optimisations", 286 | "Java 6 support", 287 | "Java 8 support", 288 | "Java 11 support", 289 | "kyori/adventure integration", 290 | "Quilt support" 291 | ], 292 | "adj": [ 293 | "bad", 294 | "wrong", 295 | "illegal", 296 | "horrible", 297 | "nasty", 298 | "not in SpigotCraft", 299 | "noncompliant with Mojang's EULA", 300 | "a serious problem", 301 | "incompatible", 302 | "a waste of time", 303 | "wonderful", 304 | "amazing", 305 | "toxic", 306 | "too vanilla", 307 | "shameful", 308 | "disappointing", 309 | "bloated", 310 | "outdated", 311 | "incorrect", 312 | "full of drama", 313 | "too realistic", 314 | "terrible", 315 | "not GPL compliant", 316 | "vomit-inducing" 317 | ], 318 | "badsoft": [ 319 | "malware", 320 | "spyware", 321 | "adware", 322 | "DRM", 323 | "viruses", 324 | "trojans", 325 | "keyloggers", 326 | "stolen code", 327 | "easter eggs", 328 | "potential login stealers", 329 | "adf.ly links", 330 | "bad code", 331 | "stolen assets", 332 | "malicious code", 333 | "secret backdoors", 334 | "kangarko/Foundation", 335 | "obfuscation", 336 | "Songoda plugins", 337 | "ransomware", 338 | "remote code execution", 339 | "precompiled Spigot binaries", 340 | "force ops", 341 | "server crashers", 342 | "arbitrary JavaScript execution", 343 | "Lombok" 344 | ], 345 | "drama": [ 346 | "bugs", 347 | "crashes", 348 | "drama", 349 | "lots of drama", 350 | "imbalance", 351 | "pain and suffering", 352 | "piracy", 353 | "bees", 354 | "adf.ly", 355 | "dupe glitches", 356 | "lighting bugs", 357 | "obfuscation", 358 | "hack clients", 359 | "premium plugins", 360 | "community feedback", 361 | "incompetence", 362 | "mass Discord pings", 363 | "damage control", 364 | "outrage", 365 | "mild annoyance", 366 | "chaos", 367 | "forking", 368 | "pumpkins masquerading as pineapples", 369 | "SPOJMAP", 370 | "flard" 371 | ], 372 | "crash": [ 373 | "crash", 374 | "explode", 375 | "break", 376 | "lag", 377 | "blow up", 378 | "corrupt chunks", 379 | "corrupt worlds", 380 | "rain hellfish", 381 | "spawn bees", 382 | "drop /nuke", 383 | "hold servers ransom", 384 | "forkbomb" 385 | ], 386 | "ban": [ 387 | "ban", 388 | "kick", 389 | "put a pumpkin of shame on", 390 | "add commands mocking", 391 | "blacklist", 392 | "whitelist", 393 | "give admin rights to", 394 | "shame", 395 | "destroy", 396 | "/nuke", 397 | "\"no u\"" 398 | ], 399 | "code": [ 400 | "code", 401 | "assets", 402 | "ideas", 403 | "concepts", 404 | "a single function", 405 | "5 lines of code", 406 | "a class", 407 | "a few files", 408 | "a ZIP file", 409 | "Gradle buildscripts", 410 | "a GitHub repository", 411 | "a pom.xml", 412 | "obfuscated class files", 413 | "precompiled binaries", 414 | "precompiled natives", 415 | "a sources jar", 416 | "a Javadoc jar", 417 | "a remapped jar" 418 | ], 419 | "worse": [ 420 | "worse", 421 | "better", 422 | "faster", 423 | "slower", 424 | "more stable", 425 | "less buggy", 426 | "more functional", 427 | "more vanilla", 428 | "less vanilla", 429 | "more buggy", 430 | "more broken", 431 | "less competent", 432 | "kangarko like" 433 | ], 434 | "ac1": [ 435 | "sue", 436 | "destroy the life of", 437 | "flame", 438 | "cause drama about", 439 | "complain about", 440 | "kick", 441 | "threaten to sue", 442 | "wave empty threats of lawsuits at", 443 | "DMCA", 444 | "yell in IRC about", 445 | "randomly ping", 446 | "decompile", 447 | "enforce the GPL against", 448 | "insult the code of", 449 | "rant about", 450 | "expose" 451 | ], 452 | "forks": [ 453 | "forks", 454 | "rebrands", 455 | "hard forks", 456 | "upstreams" 457 | ], 458 | "price": [ 459 | "$100", 460 | "$200", 461 | "$250", 462 | "$300", 463 | "$350", 464 | "$400", 465 | "$450", 466 | "$500", 467 | "$600", 468 | "$1,000,000", 469 | "$15", 470 | "$5", 471 | "€100", 472 | "€250" 473 | ], 474 | "activates": [ 475 | "activates", 476 | "works", 477 | "functions", 478 | "breaks", 479 | "disables", 480 | "extracts", 481 | "enhances", 482 | "corrupts", 483 | "deletes", 484 | "initialises" 485 | ], 486 | "says": [ 487 | "says", 488 | "tweets", 489 | "claims", 490 | "confirms", 491 | "denies", 492 | "announces", 493 | "agrees", 494 | "spams", 495 | "declares", 496 | "pings @everyone to announce", 497 | "rants", 498 | "locks the SpigotMC Discord for a two hour long monologue to state", 499 | "sets up a bot to say", 500 | "reveals", 501 | "posts" 502 | ], 503 | "enormous": [ 504 | "big", 505 | "large", 506 | "huge", 507 | "gigantic", 508 | "enormous", 509 | "colossal", 510 | "Hypixel-sized" 511 | ], 512 | "payment": [ 513 | "PayPal", 514 | "Xsolla", 515 | "Mollie", 516 | "Stripe", 517 | "Patreon", 518 | "Open Collective", 519 | "Ko-fi", 520 | "Tebex", 521 | "GitHub Sponsors" 522 | ], 523 | "document": [ 524 | "code of conduct", 525 | "community guidelines", 526 | "contributing guide", 527 | "contributor license agreement" 528 | ], 529 | "events": [ 530 | "Hacktoberfest", 531 | "Google Summer of Code", 532 | "State of Sponge" 533 | ], 534 | "platforms": [ 535 | "Bukkit", 536 | "Bungeecord", 537 | "Paper", 538 | "Sponge", 539 | "Velocity", 540 | "Forge", 541 | "Fabric", 542 | "CanaryMod", 543 | "Cloudburst", 544 | "Geyser", 545 | "Quilt", 546 | "FlintMC" 547 | ] 548 | }, 549 | "sentences": [ 550 | "[people] launched a DoS attack on the website of [things]", 551 | "[sites] urges everyone to stop using [things]", 552 | "After a [enormous] amount of requests, [servers] removes [things]", 553 | "After a [enormous] amount of requests, [servers] adds [things]", 554 | "After a [enormous] amount of requests, [servers] adds [function] to [things]", 555 | "[people] plays [things] on Twitch", 556 | "[people] fixes [function] in [things] to be unlike [things]", 557 | "[things] makes [things] [crash], [sites] users complain", 558 | "[people] complained about being in [things] on [sites]", 559 | "[people] releases [code] of [things] for [price]", 560 | "[sites] considers [things] worse than [things]", 561 | "[people] made [things] depend on [things]", 562 | "[people] bans [people] from using [things] on [servers]", 563 | "[people] complains that [things] discussion doesn't belong on [sites]", 564 | "[people] has a Patreon goal to add [function] to [things] for [price] a month", 565 | "[people] has a Patreon goal to add [things] compatibility to [things] for [price] a month", 566 | "[people] complains that [people] replaced [things] by [things]", 567 | "[people] complains that [people] replaced [things] by [things] on [servers]", 568 | "[people] complains that [people] removed [function] on [servers]", 569 | "[people] decided that [things] is too [adj] and replaced it with [things]", 570 | "[people] [says] [things] is [adj]", 571 | "[people] [says] [things] is literally [adj]", 572 | "[things] is not updated for the latest version of Minecraft", 573 | "[people] removes [things] from [servers]", 574 | "[people] adds [things] to [servers]", 575 | "[people] quits plugin development. Fans of [things] rage.", 576 | "[people] is found to secretly like [things]", 577 | "[people] openly hates [function] in [things]", 578 | "[people] threatens to [ac1] [people] until they remove [things] from [servers]", 579 | "[people] threatens to [ac1] [people] until they remove [function] from [things]", 580 | "[people] threatens to [ac1] [people] until they add [function] to [things]", 581 | "[people] came out in support of [things]", 582 | "[people] came out in support of [drama]", 583 | "[people] and [people] came out in support of [drama]", 584 | "[people] came out against [drama], [sites] rages", 585 | "[people] and [people] came out against [drama], [sites] rages", 586 | "[people] forks [things] causing [drama]", 587 | "[people] [says] to replace [things] with [things]", 588 | "[people] [says] [people] causes drama", 589 | "[things] fans claim that [things] should be more like [things]", 590 | "[things] fans claim that [things] should have better [function]", 591 | "[people] [says] that [things] should be more like [things]", 592 | "[people] [says] that [things] should be less like [things]", 593 | "[people] rebalances [things] for [servers]", 594 | "[people] adds [function] to [things] by request of [people]", 595 | "[people] removes [function] from [things] by request of [people]", 596 | "[people] removes compatibility between [things] and [things] by request of [people]", 597 | "[people] [says] [people]'s attitude is [adj]", 598 | "[people] [says] [sites]'s attitude is [adj]", 599 | "[people] quits the development team of [things]", 600 | "[people] [says] [things] is too much like [things]", 601 | "[people] [says] [things] is a ripoff of [things]", 602 | "[people] [says] [people] stole [code] from [people]", 603 | "[people] [says] [people] did not steal [code] from [people]", 604 | "[people] decides to [ban] [people] from [servers]", 605 | "[things] doesn't work with [things] since the latest update", 606 | "[people] sues [things]", 607 | "[people] [says] [things] is [adj] on [sites]", 608 | "[people] [says] [things] is full of [badsoft]", 609 | "[people] [says] [things] causes [drama]", 610 | "[people] [says] [things] causes [drama] when used with [things]", 611 | "[people] [says] using [things] and [things] together is [adj]", 612 | "[people] rants about [things] on [sites]", 613 | "[people] rants about [function] in plugins on [sites]", 614 | "[people] steals code from [things]", 615 | "[things] breaks [function]", 616 | "[people] sues [things] developers", 617 | "[people] reminds you that [things] is [adj]", 618 | "[people] and [people] get into a drama fight on [sites]", 619 | "Fans of [things] and [things] argue on [sites]", 620 | "[people] and [people] argue about [things]", 621 | "[people] puts [badsoft] in [things]", 622 | "[people] complains about [things] breaking [things]", 623 | "[people] complains about [things] breaking [function]", 624 | "[people] complains about [things] including [function]", 625 | "[things] breaks [function] in [things]", 626 | "[things] breaks [things] support in [things]", 627 | "[things] adds code to [ban] [people] automatically", 628 | "[things] adds code to [ban] people using [things]", 629 | "[things] removes compatibility with [things]", 630 | "[people] [says] not to use [things]", 631 | "[people] [says] not to use [things] with [things]", 632 | "[people] finds [badsoft] in [things]", 633 | "[people] drew a nasty graffiti about [people]", 634 | "[people] drew a nasty graffiti about [things]", 635 | "[things] makes [things] [crash] when used with [things]", 636 | "[things] makes [things] [crash] when used by [people]", 637 | "[things] makes [things] crash [things] when used by [people]", 638 | "[things] adds [badsoft] that only [activates] on [servers]", 639 | "[things] adds [badsoft] that only [activates] alongside [things]", 640 | "[things] makes [people] invincible from [things] on [servers]", 641 | "[people] decides to base their entire server on [things]", 642 | "[people] tweaks balance in [things] too much, annoying [sites]", 643 | "[people] tweaks balance in [things] too much, annoying [people]", 644 | "[people] [says] [people] is worse than [people]", 645 | "[people] [says] [things] is [worse] than [things]", 646 | "[people] bans [people] from [sites]", 647 | "[payment] suspends [people]'s account", 648 | "[payment] suspends [servers]'s account", 649 | "[payment] freezes [people]'s account", 650 | "[payment] freezes [servers]'s account", 651 | "[payment] suspends [people]'s account because of [drama]", 652 | "[payment] suspends [servers]'s account because of [drama]", 653 | "[payment] freezes [people]'s account because of [drama]", 654 | "[payment] freezes [servers]'s account because of [drama]", 655 | "[people] [says] [payment] is [adj]", 656 | "[people] [says] [payment] is [worse] than [payment]", 657 | "[people] decides to rewrite [things] to be more like [things]", 658 | "[people] decides to rewrite [things] to be less like [things]", 659 | "[people] ignores [people]'s complaints about [sites], causing more [drama]", 660 | "[people] ignores [sites]'s complaints about [sites], causing more [drama]", 661 | "[people] grows tired of [people] and quits [sites]", 662 | "[people] ignores [people]'s complaints about [things], causing more [drama]", 663 | "[people] ignores [sites]'s complaints about [things], causing more [drama]", 664 | "[people] deletes [people]'s posts on [sites] to protect their reputation", 665 | "[people] does nothing about [drama], as usual", 666 | "[people] steals code from [people]", 667 | "[people] releases [code] from [things] as a standalone library for [function]", 668 | "[people] [says] users of [things] should feel bad", 669 | "[people] rewrites [things] to focus on [function] instead of [function]", 670 | "[people] reconciles with [people], causing [drama]", 671 | "[people] reconciles with [people], causing [drama] on [sites]", 672 | "[people] [says] people should accept [people], causing [drama]", 673 | "[people] [says] people should accept [people], causing [drama] on [sites]", 674 | "[sites] updates their [document], causing [drama]", 675 | "[sites] updates their [document], [sites] rages", 676 | "[sites] updates their [document], [people] quits in protest", 677 | "[things] updates their [document], causing [drama]", 678 | "[things] updates their [document], [sites] rages", 679 | "[things] updates their [document], [people] quits in protest", 680 | "[people] adds [code] to [things] for [events]", 681 | "[sites] adds [code] to [things] for [events]", 682 | "[people] adds [badsoft] to [things] for [events]", 683 | "[sites] adds [badsoft] to [things] for [events]", 684 | "[people] adds [code] to [things] for [events], causing [drama]", 685 | "[sites] adds [code] to [things] for [events], causing [drama]", 686 | "[people] adds [badsoft] to [things] for [events], causing [drama]", 687 | "[sites] adds [badsoft] to [things] for [events], causing [drama]", 688 | "[people] adds [code] to [things] for [events], causing [drama] on [sites]", 689 | "[sites] adds [code] to [things] for [events], causing [drama] on [sites]", 690 | "[people] adds [badsoft] to [things] for [events], causing [drama] on [sites]", 691 | "[sites] adds [badsoft] to [things] for [events], causing [drama] on [sites]", 692 | "[people] bans [people] from [sites] for misconduct during [events]", 693 | "[people] ports [things] to [platforms]", 694 | "[people] ports [things] to [platforms], causing [drama]", 695 | "[people] ports [things] to [platforms], causing [drama] on [sites]", 696 | "[people] ports [things] to [platforms], [sites] rages", 697 | "[people] removes [platforms] support from [things]", 698 | "[people] removes [platforms] support from [things], causing [drama]", 699 | "[people] removes [platforms] support from [things], causing [drama] on [sites]", 700 | "[people] removes [platforms] support from [things], [sites] rages", 701 | "[people] bans [platforms]-related software from [sites]", 702 | "[people] bans [things] from [sites] for breaking the [document]", 703 | "[people] bans [people] from [sites] for breaking the [document]", 704 | "[people] joins governments around to world to ruin [things]", 705 | "[people] joins governments around to world to ruin [badsoft]", 706 | "[people] joins governments around to world to ruin [sites]", 707 | "[people] joins governments around to world to ruin [servers]", 708 | "[people] [forks] [things]", 709 | "[people] [forks] [things], causing [drama]", 710 | "[people] [forks] [things], causing [drama] on [sites]", 711 | "[people] causes [drama], [people] [forks] [things] in protest", 712 | "[sites] [forks] [things]", 713 | "[sites] [forks] [things], causing [drama]", 714 | "[sites] [forks] [things], causing [drama] on [sites]", 715 | "[people] causes [drama], [sites] [forks] [things] in protest", 716 | "[sites] considers [things] [worse] than [things]", 717 | "[people] considers [things] [worse] than [things]" 718 | ], 719 | "social": [ 720 | "Hot off the press!", 721 | "This just in!", 722 | "Fresh drama!", 723 | "Breaking news!", 724 | "Drama alert!", 725 | "Trending on Twitter!", 726 | "Trending on Hacker News!", 727 | "Trending on Reddit!", 728 | "Hot topic!", 729 | "Things just got interesting..." 730 | ] 731 | } 732 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | const { randomIndex, randomEntry } = require("./util"); 2 | const { combinations, sentences, social } = require("./data.json"); 3 | 4 | function renderDrama(message, share, sharePath, teaser) { 5 | return ` 6 | 7 | 8 | Spigot Drama Generator 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 28 | 65 | 66 | 67 |

Spigot Drama Generator

68 |

${message}

69 | 70 |
71 | Generate more drama! (or press enter) 72 |
73 |
74 | This website is made in jest - don't take it too seriously! 75 |
76 | Developed by mdcfe; PRs welcome on GitHub. 77 |
78 | Inspired by (and heavily borrows from) asiekierka's Minecraft Drama Generator. 79 |
80 |
81 | Unofficial alternative forms: Chew's JSON API | Twitter bot 82 |
83 | Long live Syscraft! 84 |
85 | 86 | 87 | ` 88 | } 89 | 90 | function handleRoot(url) { 91 | let drama = {}; 92 | 93 | drama.sentence = randomIndex(sentences); 94 | 95 | for (key in combinations) { 96 | drama[key] = [randomIndex(combinations[key]), randomIndex(combinations[key]), randomIndex(combinations[key]), randomIndex(combinations[key])]; 97 | } 98 | 99 | const dramaUrl = btoa(JSON.stringify(drama)); 100 | const host = url.host == "example.com" ? "localhost:8787" : url.host; 101 | 102 | return handleDrama(new URL(`${url.protocol}//${host}/${dramaUrl}`)); 103 | } 104 | 105 | function handleDrama(url) { 106 | try { 107 | let dramaIds = JSON.parse(atob(url.pathname.split("/")[1])); 108 | let usedDramaIds = { sentence: dramaIds.sentence }; 109 | let message = sentences[dramaIds.sentence]; 110 | 111 | for (key in combinations) { 112 | const placeholder = `[${key}]`; 113 | if (!message.includes(placeholder)) continue; 114 | usedDramaIds[key] = []; 115 | for (id of dramaIds[key]) { 116 | if (!message.includes(placeholder)) continue; 117 | usedDramaIds[key].push(id); 118 | 119 | const replacement = combinations[key][id]; 120 | message = message.replace(placeholder, replacement); 121 | } 122 | } 123 | 124 | url.pathname = "/" + btoa(JSON.stringify(usedDramaIds)); 125 | 126 | let teaser = randomEntry(social); 127 | 128 | return new Response(renderDrama(message, url.href, url.pathname, teaser), { 129 | headers: { 130 | "content-type": "text/html;charset=utf8" 131 | } 132 | }); 133 | } catch (error) { 134 | return handle404(); 135 | } 136 | } 137 | 138 | function handle404() { 139 | return new Response("no u", { 140 | status: "404" 141 | }); 142 | } 143 | 144 | addEventListener('fetch', event => { 145 | event.respondWith(handleRequest(event.request)) 146 | }) 147 | /** 148 | * Respond with hello worker text 149 | * @param {Request} request 150 | */ 151 | async function handleRequest(request) { 152 | let url = new URL(request.url); 153 | if (url.pathname == "/") { 154 | return handleRoot(url); 155 | } else if (url.pathname == "/favicon.ico") { 156 | return handle404(); 157 | } else { 158 | return handleDrama(url); 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /src/util.js: -------------------------------------------------------------------------------- 1 | export function randomIndex(array) { 2 | return Math.floor(Math.random() * array.length); 3 | } 4 | 5 | export function randomEntry(array) { 6 | return array[randomIndex(array)]; 7 | } -------------------------------------------------------------------------------- /wrangler.toml: -------------------------------------------------------------------------------- 1 | name = "spigot-drama-generator" 2 | type = "webpack" 3 | account_id = "c29688adad64beb8d6171dae3d0c394c" 4 | workers_dev = true 5 | route = "" 6 | zone_id = "" 7 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | prettier@^1.18.2: 6 | version "1.19.1" 7 | resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" 8 | integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== 9 | --------------------------------------------------------------------------------