Skip to content
a js module + cli tool for helping name sprints with dinosaurs and an adjective
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
.prettierrc
.travis.yml
ReadMe.md
adjectives.js
adjectives.spec.js
cli.js
dinos.js
dinos.spec.js
jest.config.js
lib.js
lib.spec.js
package-lock.json
package.json
util.js
util.spec.js

ReadMe.md

Dino Sprint Namer

NPM Version Build Status Code Coverage License

Provides a dinosaur sprint name in the format of <adjective> <dinosaur>.

Installation

npm install --global dino-sprint-namer

Usage

Try CLI

npx dino-sprint-namer (a)

CLI

To use, invoke the CLI tool via:

dino-sprint-namer (a)

Module

const dinos = require('dino-sprint-namer');

console.log('random dino: ', dinos.random());
console.log('dino that starts with a: ', dinos.startsWith('a'));

Specifying Starting Letter

An optional starting letter can be specified as an argument. This will cause both the adjective (first word) and dinosaur name to start with the corresponding letter.

Updating

To rebuild the array of dinosaurs from dinos.js:

  • navigate to the A-Z listing
    • this must be done in a browser from the site, as they use the appropriate CORS and CSP headers to prevent fetching from another origin
  • in js console, execute:
    var list = document.querySelector('.dinosaurfilter--container');
    var dinoList = Array.from(list.querySelectorAll('p.dinosaurfilter--name')).map(el => el.innerText.trim());
    var dinoAr = Array.from(list.querySelectorAll('p.dinosaurfilter--name')).map(el => {
      return {
        name: el.innerText.trim(),
        url: el.parentElement.href
      };
    });
    console.log(dinoAr);

Images

The dinos.js array includes a reference to the dinosaur specific page. From that page, the image can be grabbed as such:

var article = document.querySelector('dinosaur--container');
var img = article.querySelector('img.dinosaur--image');

A future feature is to include an image from the resulting:

  • top clipart search result (a la "I'm feeling lucky" from Google) for the adjective
  • the selected dinosaur

Inspiration

To eliminate the madness of semi-randomly selecting dinosaur names as sprint names, this should provide a consistent naming scheme and ability to provision the starting letter, for progression.

Credits

I'm grabbing the list of dinosaurs from The Natural History Museum of the UK.

License

MIT

You can’t perform that action at this time.