PHP Class Phergie_Plugin_Weather, phergie

Inheritance: extends Phergie_Plugin_Abstract
Show file Open project: phergie/phergie

Protected Properties

Property Type Description
$isLocationReliable boolean True if the last fetched location was reliable

Public Methods

Method Description
getWeatherData ( string $location ) : array Retrieve TWCi Content
getWeatherLocation ( string $location ) : string | boolean Tries to find the api-readable id of the given location returns the location if found, false if not found
onCommandWeather ( string $location ) : void Returns a weather report for a specified location.
onLoad ( ) : void Checks for dependencies.

Protected Methods

Method Description
getWeatherReport ( string $location ) : void Generates a weather report for a specified location

Method Details

getWeatherData() public method

Retrieve TWCi Content
public getWeatherData ( string $location ) : array
$location string place to retrieve weather data for
return array weather conditions

getWeatherLocation() public method

It also sets $this->isReliable, which is set to false when the current location isn't verfied yet
public getWeatherLocation ( string $location ) : string | boolean
$location string Location to search
return string | boolean

getWeatherReport() protected method

@param string $location name of place to retrieve weather report for
protected getWeatherReport ( string $location ) : void
$location string
return void

onCommandWeather() public method

Returns a weather report for a specified location.
public onCommandWeather ( string $location ) : void
$location string Zip code or city/state/country specification
return void

onLoad() public method

Checks for dependencies.
public onLoad ( ) : void
return void

Property Details

$isLocationReliable protected property

True if the last fetched location was reliable
protected bool $isLocationReliable
return boolean