Created
June 28, 2016 17:45
-
-
Save halgatewood/d03e6577f794b93777a5a46577d9b448 to your computer and use it in GitHub Desktop.
Get the weather and time of day to display custom images, videos, etc with the Awesome Weather Widget
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // OPENWEATHERMAPS: | |
| $weather_name = awesome_weather_preset_condition_names_openweathermaps( $weather->data['current']['condition_code']); | |
| // YAHOO | |
| $weather_name = awesome_weather_preset_condition_names_yahoo( $weather->data['current']['condition_code']); | |
| $current_time = get_the_time('H'); | |
| $tm = ( $current_time < 6 AND $current_time > 9 ) ? "night" : "day"; | |
| // GET THE FILE | |
| $filename = $weather_name . "-" . $tm . ".mp4"; | |
| // $filename would be like: cloudy-day.mp4, sunny-night.mp4, windy-day.mp4, etc | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment