Javascript 在Shinydashboard中显示Openweather小部件

Javascript 在Shinydashboard中显示Openweather小部件,javascript,html,r,shinydashboard,openweathermap,Javascript,Html,R,Shinydashboard,Openweathermap,我正在为一位同事构建一个仪表板,她要求我在仪表板中显示一个城市的实时天气。我在网上看了看,我看到了一些非常简单的来自黑暗天空的天气代码。它被嵌入到一个iframe中。我本来想这么做的,但是黑暗的天空没有给我更多的API密钥。因此,我在网上找到了另一个名为“开放天气”的天气源,我得到了一个API密钥,并尝试了以下代码 tabItem(tabName = 'weather', fluidRow( tags$iframe( seamless =

我正在为一位同事构建一个仪表板,她要求我在仪表板中显示一个城市的实时天气。我在网上看了看,我看到了一些非常简单的来自黑暗天空的天气代码。它被嵌入到一个iframe中。我本来想这么做的,但是黑暗的天空没有给我更多的API密钥。因此,我在网上找到了另一个名为“开放天气”的天气源,我得到了一个API密钥,并尝试了以下代码

    tabItem(tabName = 'weather',
      fluidRow(
        tags$iframe(
          seamless = "seamless",
          src = "http://api.openweathermap.org/data/2.5/forecast?id=2761333&APPID= my key",
          height = 800,
          width = 1400
        )
      )
    )
我没有收到任何错误消息或任何东西,但在仪表板上,您只看到类似的内容

{"cod":"200","message":0,"cnt":40,"list":[{"dt":1596456000,"main":{"temp":293.37,"feels_like":293.3,"temp_min":293.37,"temp_max":293.86,"pressure":1009,"sea_level":1009,"grnd_level":987,"humidity":79,"temp_kf":-0.49},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":{"all":59},"wind":{"speed":3.19,"deg":206},"visibility":10000,"pop":0.87,"rain":{"3h":1.77},"sys":{"pod":"d"},"dt_txt":"2020-08-03 12:00:00"},{"dt":1596466800,"main":
基本上就是数据。我认为这将是一个远大的希望,但我在网站上看到,他们有一个小部件构造函数,他们给了我什么样的HTML代码。以下是:

<div id="openweathermap-widget-21"></div>
<script src='//openweathermap.org/themes/openweathermap/assets/vendor/owm/js/d3.min.js'></script><script>window.myWidgetParam ? window.myWidgetParam : window.myWidgetParam = [];  window.myWidgetParam.push({id: 21,cityid: '2761367',appid: 'my key',units: 'metric',containerid: 'openweathermap-widget-21',  });  (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>

window.mywidgetpram?window.mywidgetpram:window.mywidgetpram=[];push({id:21,cityid:'2761367',appid:'my key',units:'metric',containerid:'openweathermap-widget-21',});(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);});
这应该是一个从网站上看起来像这样的小部件,但我不是一个开发人员,我只是使用R和闪亮的仪表板对我来说是新的,所以我不确定如何将这个小部件以闪亮的颜色显示每日天气。如果有人能告诉我如何做这件事或其他方式,我将不胜感激