Skip to content
This repository has been archived by the owner on Dec 18, 2021. It is now read-only.
/ mixed-messages Public archive

A portfolio project from Codecademy.

Notifications You must be signed in to change notification settings

tE3m/mixed-messages

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mixed messages

General

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.

How does it work?

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.

Installation and usage

$ 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.

Dependencies

  • isomorphic-fetch
  • jsdom
  • @stdlib/datasets-male-first-names-en
  • @stdlib/datasets-female-first-names-en

Collaboration

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.

About

A portfolio project from Codecademy.

Resources

Stars

Watchers

Forks