badevann
v3.0.0
Published
Kommandolinjeverktøy med badetemperaturer fra hele Norge
Maintainers
Readme
🏝 BADEVANN 🏊♂️
A CLI tool that fetches and displays water temperatures from beaches in Norway.
Installation 💾
Use the npm command line tool that comes with node.js
Minimum required node version is 14
Run the following from your terminal:
# Install globally
npm i -g badevann
# Or run directly from the repository
npm install
npm startUsage 💻
badevann lets you browse beaches by county or municipality, search for beaches, and check today's highest water temperatures.
Alternatively, you can type badevann <beach> to fetch the temperature for <beach> directly.
Command Line Arguments ⌨️
horhelp: Display help text and exitvorverbose: Show detailed beach informationioriso: Show timestamps in ISO 8601 formatsorshort: Show only temperaturenocolor: Display temperature without color (<20°C is blue, 20-25°C is green, and >25°C is red)dordebug: Show debug information during use
Examples
badevann short: Show the main menu, and when you select a beach, only the temperature is displayedbadevann storøyodden s: Get water temperature from Storøyodden, show only temperaturebadevann kalvøya v: Get water temperature from Kalvøya, show detailed information about the beachbadevann sørenga iso: Get water temperature from Sørenga in ISO 8601 format
Features
- Interactive CLI with search and selection menus
- Data caching to minimize API calls
- Color-coded temperature display
- Multiple output formats (short, long, ISO)
- Customizable user settings
Project Structure
The application is organized as follows:
badevann/
├── bin/ # CLI entry point
├── src/
│ ├── core/ # Core application logic
│ ├── services/ # Data services and API integration
│ ├── ui/ # User interface components
│ └── utils/ # Utility functions and helpers
└── package.jsonPowerlevel10k Integration
If you're running zsh (standard shell on macOS) with powerlevel10k, you can get water temperature from your favorite beach as a prompt element:
Add the
badevanncall as a variable in~/.zshrc, e.g.:temp="$(badevann storøyodden s)"(remember the s parameter to only get the temperature).
Open
~/.p10k.zsh, and create a function calledprompt_bathing_temp, like this:function prompt_bathing_temp() { p10k segment -b cyan -f black -i '🌡' -t $temp }Add
bathing_tempas a line undertypeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS.
This refers to theprompt_bathing_tempfunction.Save
~/.p10k.zshand~/.zshrc, and restart your terminal.Now the water temperature will be displayed in your shell prompt.
Data Source 💽
All data comes primarily from YR.no.
If you encounter issues with the app, check the website or log an issue on GitHub.
