2017 © Pedro Peláez
 

library shippingforecast

Shipping Forecast scraping library, pulling data from the BBC's shipping forecast page. Based on tnm/shipping-forecast

image

johnnymck/shippingforecast

Shipping Forecast scraping library, pulling data from the BBC's shipping forecast page. Based on tnm/shipping-forecast

  • Saturday, July 28, 2018
  • by johnnymck
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

ShippingForecast.php

A straight-forward shipping forecast API written in pure PHP which scrapes up-to-date info from the BBC shipping forecast webpage., (*1)

Source based on Ted Nyman's shipping forecast project. Mega props to that guy! :), (*2)

Installation

composer install johnnymck/shippingforecast, (*3)

Usage

use ShippingForecast\ShippingForecast;

$forecast = new ShippingForecast();
$cromarty = $forecast->get('Cromarty'); // location names must be capitalised

echo $cromarty['time']; // eg,  'The general synopsis at 1800'...
print_r($cromarty['content']['warning']); // returns array of warnings (often empty, though not in wintertime 😅)
echo $cromarty['content']['visibility']; // eg, 'Good, occasionally poor'...

It's worth noting that ShippingForecast::get($foo) and ShippingForecast::getAll() both yeild an assoc array containing ['time'], the time as a string when last updated by the BBC, and ['content'] which contains the forecast-proper, including a ['warning'] array to yeild any prevalent warning information. See examples/ for further information., (*4)

Fun Stuff!

Running php readforecast.php in the root of the application and piping the output into a text-to-speech application (such as say on Macintosh) will read the latest forecast update without you having to bother tuning your wireless sets to BBC R4, 3 times a day. What a time to be alive!, (*5)

./forecast [Capitalised zone name here] will return the forecast in plaintext in your desired zone, (*6)

The Versions

28/07 2018

dev-master

9999999-dev

Shipping Forecast scraping library, pulling data from the BBC's shipping forecast page. Based on tnm/shipping-forecast

  Sources   Download

BSD-2-Clause

The Requires

 

28/07 2018

0.1.0

0.1.0.0

Shipping Forecast scraping library, pulling data from the BBC's shipping forecast page. Based on tnm/shipping-forecast

  Sources   Download

BSD-2-Clause

The Requires