mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-08-13 23:51:46 +00:00
added composer.json and needed libs
This commit is contained in:
parent
4f1fb007c5
commit
1f74d409a2
42 changed files with 4413 additions and 0 deletions
82
curweather/vendor/cmfcmf/openweathermap-php-api/Cmfcmf/OpenWeatherMap/Util/Weather.php
vendored
Normal file
82
curweather/vendor/cmfcmf/openweathermap-php-api/Cmfcmf/OpenWeatherMap/Util/Weather.php
vendored
Normal file
|
@ -0,0 +1,82 @@
|
|||
<?php
|
||||
/**
|
||||
* OpenWeatherMap-PHP-API — A php api to parse weather data from http://www.OpenWeatherMap.org .
|
||||
*
|
||||
* @license MIT
|
||||
*
|
||||
* Please see the LICENSE file distributed with this source code for further
|
||||
* information regarding copyright and licensing.
|
||||
*
|
||||
* Please visit the following links to read about the usage policies and the license of
|
||||
* OpenWeatherMap before using this class:
|
||||
*
|
||||
* @see http://www.OpenWeatherMap.org
|
||||
* @see http://www.OpenWeatherMap.org/terms
|
||||
* @see http://openweathermap.org/appid
|
||||
*/
|
||||
|
||||
namespace Cmfcmf\OpenWeatherMap\Util;
|
||||
|
||||
/**
|
||||
* The weather class representing a weather object.
|
||||
*/
|
||||
class Weather
|
||||
{
|
||||
/**
|
||||
* @var int The weather id.
|
||||
*/
|
||||
public $id;
|
||||
|
||||
/**
|
||||
* @var string The weather description.
|
||||
*/
|
||||
public $description;
|
||||
|
||||
/**
|
||||
* @var string the icon name.
|
||||
*/
|
||||
public $icon;
|
||||
|
||||
/**
|
||||
* @var string The url for icons.
|
||||
*
|
||||
* @see self::getIconUrl() to see how it is used.
|
||||
*/
|
||||
private $iconUrl = "http://openweathermap.org/img/w/%s.png";
|
||||
|
||||
/**
|
||||
* Create a new weather object.
|
||||
*
|
||||
* @param int $id The icon id.
|
||||
* @param string $description The weather description.
|
||||
* @param string $icon The icon name.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
public function __construct($id, $description, $icon)
|
||||
{
|
||||
$this->id = (int)$id;
|
||||
$this->description = (string)$description;
|
||||
$this->icon = (string)$icon;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the weather description.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the icon url.
|
||||
*
|
||||
* @return string The icon url.
|
||||
*/
|
||||
public function getIconUrl()
|
||||
{
|
||||
return str_replace("%s", $this->icon, $this->iconUrl);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue