Skip to content

Instantly share code, notes, and snippets.

@halgatewood
Last active June 7, 2016 04:26
Show Gist options
  • Select an option

  • Save halgatewood/1dc6531b2f1a9baa22f626cb0bf0ef29 to your computer and use it in GitHub Desktop.

Select an option

Save halgatewood/1dc6531b2f1a9baa22f626cb0bf0ef29 to your computer and use it in GitHub Desktop.
Extracting Weather Data from Awesome Weather Pro
<?php
include( dirname(__FILE__) . "/../../plugins/awesome-weather-pro/pro/openweathermaps/funcs.php");
$weather_settings = new stdclass;
$weather_settings->location = 'Edmond, OK';
$weather_settings->owm_city_id = 4535740;
$weather_settings->transient_name = 'awe-edmond-weather-c';
$weather_settings->forecast_days = 5;
$weather_settings->units_query = 'metric';
$weather = awesome_weather_get_weather_data_openweathermaps( $weather_settings );
if( $weather['current']['temp'] > 10 )
{
echo "Above 10";
}
else
{
echo "Below 10";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment