https://github.com/edm00se/dino-sprint-namer
a js module + cli tool for helping name sprints with dinosaurs and an adjective
https://github.com/edm00se/dino-sprint-namer
cli dino-sprint-namer dinosaur javascript naming naming-convention sprint
Last synced: about 2 months ago
JSON representation
a js module + cli tool for helping name sprints with dinosaurs and an adjective
- Host: GitHub
- URL: https://github.com/edm00se/dino-sprint-namer
- Owner: edm00se
- Created: 2018-11-29T04:13:13.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-10-25T19:42:37.000Z (over 1 year ago)
- Last Synced: 2024-04-14T06:14:52.558Z (about 1 year ago)
- Topics: cli, dino-sprint-namer, dinosaur, javascript, naming, naming-convention, sprint
- Language: JavaScript
- Homepage:
- Size: 2.14 MB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: ReadMe.md
Awesome Lists containing this project
README
# Dino Sprint Namer
[](https://www.npmjs.com/package/dino-sprint-namer)   [](https://codecov.io/gh/edm00se/dino-sprint-namer) [](https://www.npmjs.com/package/dino-sprint-namer#license)Provides a dinosaur sprint name in the format of ` `.
## Installation
```sh
npm install --global dino-sprint-namer
```## Usage
### Try CLI
```sh
npx dino-sprint-namer (a)
```### CLI
To use, invoke the CLI tool via:
```sh
dino-sprint-namer (a)
```### Module
```js
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](http://www.nhm.ac.uk/discover/dino-directory/name/name-az-all.html)
- 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:
```js
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:
```js
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](http://www.nhm.ac.uk/).
## License
MIT