dev-master
9999999-dev https://github.com/slruslan/gismeteo-weather-apiA simple PHP wrapper for Gismeteo private weather endpoints
GPL
The Requires
- php >=5.6
- guzzlehttp/guzzle ^6.2
A simple PHP wrapper for Gismeteo private weather endpoints
Simple PHP wrapper for Gismeteo private API., (*2)
Uses Android application endpoints, so you don't need token., (*3)
Using Composer:, (*4)
``` bash $ composer require slruslan/gismeteo-weather-api --dev, (*5)
## Usage Initialize wrapper instance: ```php $api = new \Slruslan\Gismeteo\Gismeteo();
Get forecast:, (*6)
// Pass your city id. // See below how to get it $cityId = 5233; // Get forecast $forecast = $api->getForecast($cityId); // Get current weather data: var_dump($forecast->fact->values); // Get weather forecast for week: var_dump($forecast->days); // Get info for the city you specified: var_dump($forecast->location);
The library isn't really high-documented and most fields are unknown. If you know anything about that response fields, feel free sending pull requests., (*7)
Go to gismeteo.ru and open the city you wish., (*8)
Then in the page URL you'll see the number, which is city id itself., (*9)
For example:, (*10)
URL: https://www.gismeteo.ru/weather-sochi-5233/now/ So the city ID for Sochi is 5233., (*11)
If you download this library and see it doesn't work, it means Gismeteo changed API endpoint url., (*12)
To find a new one, download latest version of Android application (https://4pda.ru/forum/index.php?showtopic=658787) and install apktool., (*13)
Decompile the app, using apktool:, (*14)
apktool d gismeteo.apk
Open file smali/ru/gismeteo/a/d.smali and refer to line 52 (may be changed in future too)., (*15)
You'll see something like:, (*16)
const-string v1, "http://45e30b7f.services.gismeteo.ru/inform-service/a407a91cfcb53e52063b77e9e777f5bd/"
Copy this URL and paste to Gismeteo.php file in __construct() method., (*17)
Congrats! You can use the API again., (*18)
GNU General Public License v3.0 (GPL). The description is available at LICENSE file., (*19)
You can always reach me by email: dedagates@gmail.com, (*20)
Or VK: vk.com/slruslan, (*21)
A simple PHP wrapper for Gismeteo private weather endpoints
GPL