add an openweathermap widget to the webpage
[chrisu/seepark.git] / web / templates / seepark_web.html
index 746e9a5ce5cd8e134e4233d1a78b5537bd827fb3..4d136e3e6dc2bcf538c61ead8c59f8454b7ea328 100644 (file)
                        <button onclick="loaddays(365)">Jahr</button>
                </div>
 
+               <!-- openweathermap widget -->
+               <div id="openweathermap-widget-15"></div>
+               <script>
+               window.myWidgetParam ? window.myWidgetParam : window.myWidgetParam = [];
+               window.myWidgetParam.push({
+                       id: 15,
+                       cityid: '3319578',
+                       appid: '{{ apikey }}',
+                       units: 'metric',
+                       containerid: 'openweathermap-widget-15',
+                       lang: 'de',
+               });
+               (function() {
+                       var script = document.createElement('script');
+                       script.async = true;
+                       script.charset = "utf-8";
+                       script.src = "//openweathermap.org/themes/openweathermap/assets/vendor/owm/js/weather-widget-generator.js";
+                       var s = document.getElementsByTagName('script')[0];
+                       s.parentNode.insertBefore(script, s);
+               })();
+               </script>
+
                <!-- Load own javascript code -->
                <script src="{{url_for('static', filename='seepark_web.js')}}"></script>