Skip to content
Display weather from the National Weather Service
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Display weather from the National Weather Service

Getting Started

  1. Edit the Bot name and rename config.example.php to config.php
  2. If you want to use reverse GeoCoding create .secrets.php and add <?php const GEOCODING_APIKEY = "YourKey";
  3. Deploy somewhere that runs PHP.

For litespeed, I use the following .htaccess caching configuration:

<IfModule LiteSpeed>
RewriteEngine On
RewriteRule (.*\.php)?$ - [E=cache-control:max-age=60]


This project started as an experiment to learn about the National Weather Service APIs and present them conviently.

Then, since I am a sailor and I like to be my own weatherman, I started adding additional elements to make that workflow more convient too.

The primary goal is smartphone usability, especially loading time, presentation and convienience.



The core API Documentation &


The current code is bad and in the very least needs to be refactored with better error handling.

At the risk of over-engineering (for the sake of learning!) I'm contemplating:

  • It seems like there is an opportunity to define a grammar like YACC and then generate the parser from it
  • It also seems like this should be its own library that works with PSR-4: Autoloader

Weather Map Loop


Satelite Loop



WindFinder The Superforecast is based on the newest versions of high resolution weather prediction models. The Superforecast is available for Europe, North America, South Africa, Egypt and the Canary Islands. The horizontal resolution is 5 kilometers. Forecasts are computed 4 times per day. Predictions are available in time steps of 1 hour for up to 3 days into the future. Forecast and Superforecast are based on different physical models and therefore may cause divergent predictions. Due to its higher horizontal resolution the Superforecast should be more accurate, especially for locations with a complex topography and local thermal effects. The arrows point in the direction that the wind is blowing. Currents: OSCAR

Named placeholder string formatting

* Return a formatted string like vsprintf() with named placeholders.
* When a placeholder doesn't have a matching key in `$args`,
*   the placeholder is returned as is to see missing args.
* @param string $format
* @param array $args
* @param string $pattern
* @return string
function p($format, array $args, $pattern="/\{(\w+)\}/") {
	return preg_replace_callback($pattern, function ($matches) use ($args) {
		return @$args[$matches[1]] ?: $matches[0];
	}, $format);
You can’t perform that action at this time.