2017 © Pedro Peláez
 

library gismeteo-weather-api

A simple PHP wrapper for Gismeteo private weather endpoints

image

slruslan/gismeteo-weather-api

A simple PHP wrapper for Gismeteo private weather endpoints

  • Thursday, August 17, 2017
  • by slruslan
  • Repository
  • 1 Watchers
  • 2 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Gismeteo Weather API

Latest Version on Packagist License GPL, (*1)

Simple PHP wrapper for Gismeteo private API., (*2)

Uses Android application endpoints, so you don't need token., (*3)

Installation

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)

Getting city id

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)

API endpoint doesn't work anymore

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)

License

GNU General Public License v3.0 (GPL). The description is available at LICENSE file., (*19)

Contact:

You can always reach me by email: dedagates@gmail.com, (*20)

Or VK: vk.com/slruslan, (*21)

The Versions

17/08 2017

dev-master

9999999-dev https://github.com/slruslan/gismeteo-weather-api

A simple PHP wrapper for Gismeteo private weather endpoints

  Sources   Download

GPL

The Requires