Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $timestamp = time();
- $token = md5('eternalsun'.$timestamp);
- $uuid = "8211637137c4408898aceb1097921872";
- $deviceid = "315f0e802b0b49eb8404ea8056abeaaf";
- $opts = array(
- 'http'=>array(
- 'method'=>"GET",
- 'header'=>"User-Agent: yandex-weather-android/4.2.1\n" .
- "X-Yandex-Weather-Client: YandexWeatherAndroid/4.2.1\n" .
- "X-Yandex-Weather-Device: os=null;os_version=21;manufacturer=chromium;model=App Runtime for Chrome Dev;device_id=$deviceid;uuid=$uuid;\n" .
- "X-Yandex-Weather-Token: $token\n" .
- "X-Yandex-Weather-Timestamp: $timestamp\n" .
- "X-Yandex-Weather-UUID: $uuid\n" .
- "X-Yandex-Weather-Device-ID: $deviceid\n" .
- "Accept-Encoding: gzip, deflate\n" .
- "Host: api.weather.yandex.ru\n" .
- "Connection: Keep-Alive"
- )
- );
- $context = stream_context_create($opts);
- $file = file_get_contents('https://api.weather.yandex.ru/v1/forecast?geoid=100471&lang=ru', false, $context);
- header('Content-type: text/json');
- echo gzdecode($file);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement