I wanted to create a script that generates a conversation between imaginary people who exchange their favourite XKCD. In order to futureproof this script, it fetches the newest comic's index.
First, the amount of available comics is fetched by loading xkcd.com and reading out the current comic's permalink. Then, since the comics are consecutively numbered, we can generate a random number between 1 and the number of comics available for each desired person. The person's name is determined by picking a random name from stdlib's female or male name dataset. The sentence templates and names aren't reused until each has been used, since they're removed from the sentences
/maleNames
/femaleNames
list when chosen. Once the list is empty, it's refilled again.
$ cd mixed-messages
$ npm install
$ node main.js
The amount of generated people and opinions can be controlled by changing the argument in the last line.
isomorphic-fetch
jsdom
@stdlib/datasets-male-first-names-en
@stdlib/datasets-female-first-names-en
If you'd like to contribute, just create a Pull Request with your additions. The amount of sentence templates is quite poor at the moment, so that would definitely improve the amount of combinations a lot.