<commit_before><?php

define('ENDPOINT', 'http://api.openweathermap.org/data/2.5/forecast');
$cityId = trim(file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'paris'));
$APIKey = trim(file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'apikey'));

// Forging API call URL
$url = sprintf('%s?id=%s&APPID=%s&units=metric', ENDPOINT, $cityId, $APIKey);
// Calling the API and decoding the return
$jsonData = json_decode(file_get_contents($url), true);
// parsing data to make sms
$lowestTemp = (float)1000;
$highestTemp = (float)0;
$averageTemp = (float)0;
$averageWind = (float)0;
$Rain = (float)0;
$averageClouds = (float)0;
$averageSnow = (float)0;
// We use data only for today's day
$today = date('d');
$iteration = 0;
foreach ($jsonData['list'] as $data)
{
    if (date('d', $data['dt']) === $today)
    {
        if ($lowestTemp > $data['main']['temp'])
            $lowestTemp = $data['main']['temp'];
        if ($highestTemp < $data['main']['temp'])
            $highestTemp = $data['main']['temp'];
        $averageTemp += $data['main']['temp'];
        $averageWind += $data['wind']['speed'];
        if (isset($data['rain']['3h']))
            $Rain += $data['rain']['3h'];
        $averageClouds += $data['clouds']['all'];
    }
    else break;
    $iteration++;
}

if ($iteration === 0)
{
    die();
}
$averageTemp /= $iteration;
$averageWind /= $iteration;
$averageClouds /= $iteration;

$sms = sprintf('LT: %.2f, HT: %.2f, AT: %.2f, R: %.2f, AC: %.2f, AW: %.2f', $lowestTemp, $highestTemp, $averageTemp, $Rain, $averageClouds, $averageWind);
`sms $sms`;<commit_msg>Changing wind to km/h instead of m/s<commit_after><?php

define('ENDPOINT', 'http://api.openweathermap.org/data/2.5/forecast');
$cityId = trim(file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'paris'));
$APIKey = trim(file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'apikey'));

// Forging API call URL
$url = sprintf('%s?id=%s&APPID=%s&units=metric', ENDPOINT, $cityId, $APIKey);
// Calling the API and decoding the return
$jsonData = json_decode(file_get_contents($url), true);
// parsing data to make sms
$lowestTemp = (float)1000;
$highestTemp = (float)0;
$averageTemp = (float)0;
$averageWind = (float)0;
$Rain = (float)0;
$averageClouds = (float)0;
$averageSnow = (float)0;
// We use data only for today's day
$today = date('d');
$iteration = 0;
foreach ($jsonData['list'] as $data)
{
    if (date('d', $data['dt']) === $today)
    {
        if ($lowestTemp > $data['main']['temp'])
            $lowestTemp = $data['main']['temp'];
        if ($highestTemp < $data['main']['temp'])
            $highestTemp = $data['main']['temp'];
        $averageTemp += $data['main']['temp'];
        $averageWind += $data['wind']['speed'];
        if (isset($data['rain']['3h']))
            $Rain += $data['rain']['3h'];
        $averageClouds += $data['clouds']['all'];
    }
    else break;
    $iteration++;
}

if ($iteration === 0)
{
    die();
}
$averageTemp /= $iteration;
$averageWind /= $iteration;
// Wind is meter/s, we want km/h
$averageWind *= (float)3.6;
$averageClouds /= $iteration;

$sms = sprintf('LT: %.2f, HT: %.2f, AT: %.2f, R: %.2f, AC: %.2f, AW: %.2f', $lowestTemp, $highestTemp, $averageTemp, $Rain, $averageClouds, $averageWind);
`sms $sms`;
{'fraction_non_alphanumeric': 0.22022332506203474, 'fraction_numerical': 0.014267990074441687, 'mean_word_length': 4.252442996742671, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '42136', 'n_tokens_mistral': 1245, 'n_tokens_neox': 1159, 'n_words': 249}