Download the PHP package randomhost/weather without Composer

On this page you can find all versions of the php package randomhost/weather. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package weather

Build Status

NOTE: This package has been abandoned as of January 2019 due to Yahoo shutting down free access to their Weather API.

randomhost/weather

This package encapsulates functions for easy retrieval of weather data from the Yahoo Weather API. It was created as part of randomhost/webcamoverlay but is released as a separate component so it can be used in other packages.

Because it was created as a dependency of randomhost/webcamoverlay, it does only support a subset of the available weather data.

Usage

A basic approach at using this package could look like this:

This will instantiate the class, fetch the weather data and display current temperature and humidity.

Assuming that you named this file weather.php, you should now be able to access the weather data at http://example.com/weather.php

A more detailed example can be found in src/www/weather.php.

The Feed object

The Feed object is the primary object you will interact with in your application. It provides all methods required for retrieving data from the Yahoo! Weather API.

Constructor

The constructor takes 3 parameters which are all optional:

If a $locationName is given, Feed::fetchData() will be called implicitly which will automatically retrieve weather data for the given location ID and populate the data access objects accordingly.
If you do not want this, you can omit $locationName or set it to '' (an empty string) and configure the location name yourself using Feed::setLocationName().

The $systemOfUnits parameter can be used to determine the system of units to be used by the weather feed. If not given or set to '' (an empty string), it defaults to using international units (Celsius, kilometers, millibars).

$feedUrl defines the feed URL for retrieving weather data from the Yahoo! Weather API. This parameter does not usually need to be changed unless Yahoo! changes their API.

Configuring the feed

The following public methods for configuring the weather feed are available:

Retrieving data from the feed

The following public methods for retrieving data from the feed are available:

The Data\Location object

The Data\Location object represents location information of the forecast.

The following public methods for retrieving data are available:

The Data\Units object

The Data\Units object represents units for various aspects of the forecast.

The following public methods for retrieving data are available:

The Data\Wind object

The Data\Wind object represents forecast information about wind.

The following public methods for retrieving data are available:

The Data\Atmosphere object

The Data\Atmosphere object represents forecast information about current atmospheric pressure, humidity, and visibility.

The following public methods for retrieving data are available:

The Data\Astronomy object

The Data\Astronomy object represents forecast information about current astronomical conditions.

The following public methods for retrieving data are available:

The Data\Condition object

The Data\Condition object represents the current weather conditions.

The following public methods for retrieving data are available:

The Data\Forecast object

The Data\Forecast object represents the weather forecast for a specific day.

The following public methods for retrieving data are available:

Attribution Guidelines

Please note that you are required to link back to Yahoo using the link URL provided by Feed::getLink() and one of the logos Yahoo provides. Please refer to Yahoo's Attribution Guidelines for Yahoo APIs for details.

License

See LICENSE.txt for full license details.


All versions of weather with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package randomhost/weather contains the following files

Loading the files please wait ....