This site displays cocktails scraped from Wikipedia. View it here:
https://recognition101.github.io/wiki-mixer/
- Ingredients - Input the ingredients on hand, and it will display which cocktails can be made.
- Filters - Create complex filters to find cocktails with specific ingredients or drinkware.
- Storage - All ingredients and filters are saved locally between closes/refreshes.
- Offline - The page is cached and can be displayed even with no internet connection.
- Dark Mode - Respects your device's dark mode settings.
Run with: ./data/download.js.
It does the following:
- Spiders Wikipedia, caching each cocktail page in the
./data/cache.jsonfile. - For each cocktail, get a common name per ingredient.
- Example:
2 dashes scotch whiskeywould becomeScotch Whisky - Example:
1cl herbsaintwould becomeAnise Liqueur
- Example:
- Downloads all associated images (if not already downloaded) into the
./data/images/directory. - For each image, use k-means clustering in HSV space to pick 4 representative colors.
- Write all downloaded and computed data (cocktails, common ingredient names, image references, and colors) into the
./data/drinks.jsfile.
Each script can be run with npm run <TaskName>:
| Task Name | Purpose |
|---|---|
lint-types |
Uses TypeScript to strictly static-type-check all JS. |
build-lib |
Builds ./src/lib/* by running all build-lib-* tasks. |
build-lib-js |
Bundles ./build/lib-entry.js → ./src/lib/lib.js. |
build-lib-cp |
Copies ./build/lib-entry.js → ./src/lib/lib.d.ts. |