af9d4213b6c0c4fcd5f5612e90367e5d528268ce
1 <?php
declare(strict_types
=1);
5 use Cmfcmf\OpenWeatherMap
;
9 array_map(function($forecast) {
10 return $forecast->temperature
->now
->getValue();
14 (new OpenWeatherMap(OWM_API_KEY
))->getWeatherForecast(2063523, 'metric', 'en', '', 2)
17 $forecastDayLocal = DateTimeImmutable
::createFromMutable($forecast->time
->from
)->setTimezone(new DateTimeZone('Australia/Perth'));
18 return (int)(new DateTimeImmutable())->format('d') +
1 == (int)$forecastDayLocal->format('d');
22 getTelegram()->sendMessage(
24 'chat_id' => array_flip(PARTICIPANT_IDS
)['Cam'],
25 'text' => max($temps) > 30
26 ?
getString('goodnightWearShorts', ceil($temps[1]) . '°', ceil(max($temps)) . '°')
27 : getString('goodnight', ceil($temps[1]) . '°', ceil(max($temps)) . '°'),