3000 is still too much? Slaughter the worst cliches with this script!
Thanks(?) to the server downtime, we only have 3000 themes to go through this time! ...Unfortunately, too much of them are still terrible cliches! As a result, I'm posting this script again in case anyone needs it.
Quick usage
First, copy the following code into a text editor:
```js (() => { // Time to wait between requests, in milliseconds. Defaults to 0.5 seconds. const WAIT_MS = 500;
const wait = (ms) => {
return new Promise((resolve, reject) => {
setTimeout(() => resolve(), ms);
});
};
const slaughterAll = async (themes) => {
let ok = 0;
let failed = 0;
for (const set of themes) {
for (const key in set) {
let response = await fetch(`https://api.ldjam.com/vx/theme/idea/vote/no/${key}`, {
credentials: 'include',
});
await wait(WAIT_MS);
if (response.ok) {
console.log(`Slaughtered ${key} (${set[key]})`);
ok += 1;
}
else {
console.warn(`Error slaughtering ${key} (${set[key]}): ${response.status} ${response.statusText}`);
failed += 1;
}
}
}
return {
ok, failed,
};
};
slaughterAll([
// ---------- Paste lists after this line! ----------
// ---------- Paste lists before this line! ----------
])
.then((results) => console.log(`Done! ${results.ok} ok, ${results.failed} failed.`));
})() ```
Then, paste one or more of these lists between the separators:
(These lists use the same keywords from last time, but are updated for Ludum Dare 47)
- (NEW!) Longer than 25 characters, or containing any brackets or commas: https://pastebin.com/df4iwVaD
- Control/buttons: https://pastebin.com/hUg1w7ey
- Virus: https://pastebin.com/pzYWYX82
- Currency: https://pastebin.com/wjwAWBfq
- Die/lose to win: https://pastebin.com/bfyjzaFw
- Thing is key: https://pastebin.com/xHJdBvtA
- You are bad: https://pastebin.com/7dFiJ8fg
- Colors: https://pastebin.com/r7XKh0eA
After you're done, the slaughterAll section should look somewhat like:
```js slaughterAll([ // ---------- Paste lists after this line! ----------
// Themes that contain: words, words, words, words, words { "12345": "theme content", "12345": "theme content", "12345": "theme content", },
// Themes that contain: words, words, words, words, words { "12345": "theme content", "12345": "theme content", "12345": "theme content", },
// ...
// ---------- Paste lists before this line! ----------
])
```
Finally, go to https://ldjam.com/events/ludum-dare/47/theme, and paste the entire file into the web Console (F12). Press Enter and relax!
Note: Don't refresh or close the page until "Done! X ok, X failed." is printed, or you will lose your progress. It's normal for the pie chart to not update.
Making your own lists
To make your own lists, you'll need a JSON of all themes. You may find the URL by looking at the requests sent while loading https://ldjam.com/events/ludum-dare/47/theme. The URL should look like https://api.ldjam.com/vx/theme/idea/vote/get/<some_number>.
After you have obtained the list, save it as theme.json somewhere. Then, save the following Node.js script as gen_list.js in the save folder as theme.json:
```js const fs = require('fs'); const process = require('process');
let themes = fs.readFileSync('themes.json', { encoding: 'utf8', }); themes = JSON.parse(themes);
const blacklist = process.argv.slice(2); const blacklistMap = {}; for (const word of blacklist) { blacklistMap[word] = true; }
const trailingDots = /(.)+$/; const wordSeparator = /[\W_]/;
const words = {}; const killList = {};
for (const key in themes.ideas) { const theme = themes.ideas[key]; for (let word of theme.split(wordSeparator)) { word = word.replace(trailingDots, ''); word = word.toLowerCase();
if (word.length < 1) {
continue;
}
if (blacklistMap[word]) {
killList[key] = theme;
break;
}
}
}
process.stdout.write('// Themes that contain: '); process.stdout.write(blacklist.join(', ')); process.stdout.write(' '); process.stdout.write(JSON.stringify(killList, null, 4)); process.stdout.write(', '); ```
You can now generate your own lists by running this file from the command line!
node gen_list.js keyword_1 keyword_2 keyword3