嵌入天气预报的好资源

发布于 2024-07-17 18:42:26 字数 338 浏览 4 评论 0原文

我想向网站添加 5-10 天的天气预报。 我找不到提供预测嵌入代码的网站。 我发现的少数看起来很糟糕(大约 1990 年代)。 我只是想知道是否有一个看起来很干净的解决方案,我可能会在无休止的谷歌搜索中忽略它。 Flash、iframe、任何东西...

我意识到引入天气 RSS Feed 可能是唯一干净的解决方案,但我对解析 RSS feed 不太熟悉,所以这需要我付出大量的努力,因为我将深入研究文档。

**我还应该提到这个天气应用程序位于它自己的页面上。 所以,越大越好。 如果我找不到足够大的窗口,我将把它实现到一个浮动窗口(准确地说是 jQuery Overlay)中,而不是它自己的页面中。

I would like to add a 5-10 day weather forecast to a website. I'm having trouble finding a website that provides an embed code for forecasts. The few I've found look awful (circa 1990's). I was just wondering if there was a halfway clean-looking solution that I might be overlooking in my endless Google searches. Flash, iframe, anything...

I'm realizing that pulling in a weather RSS Feed might be the only clean solution, but I am not very familiar with parsing RSS feeds, so it will require a lot of labor on my end, since I'll be digging through documentation.

**I should also mention that this weather app is on it's own page. So, bigger is better. If I don't find one big enough, I'll just implement it into a floating window (jQuery Overlay, to be exact) instead of it's own page.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

兔姬 2024-07-24 18:42:26

Forecast.io 提供非常流畅的每周预测嵌入解决方案。 如果您愿意,您还可以自定义颜色和字体以匹配您的网站。 它的高度固定,宽度可变。

Forecast.io offers a very slick weekly forecast embed solution. You can also customize the colors and fonts to match your site if you like. It's fixed height, variable width.

暗地喜欢 2024-07-24 18:42:26

Weather Underground是一个成功的天气预报网站,覆盖了世界大部分地区(你没有说你需要在哪里的预测)。 他们有一个名为天气贴纸的免费工具,可以实时提供当前观测到的天气情况。 您只需在页面中嵌入图像即可。 像这样:

“点击查看英国伦敦天气预报"
(来源:wunderground.com)

他们还提供天气预报 XML feeds 和 API,但是你需要做一些工作。 或者他们可以为您构建一个自定义网站。 但你必须为此付出代价。

Weather.com 提供天气小部件,这是一个类似的想法。 您必须为此嵌入 JavaScript,所以我无法在此处显示它。 看起来他们有 RSS 源,如果您注册,您可能会能够得到更多。

Weather Underground is a successful weather forecasting site that cover most of the world (you don't say where you need the forecast for). They have something free called Weather Stickers which offer live feeds of the current observed weather situation. You just embed an image in your page. Like this:

Click for London, United Kingdom Forecast
(source: wunderground.com)

They also offer weather forecast XML feeds and API but you'd need to do some work. Or they can build you a custom site. But you have to pay for that.

Weather.com offer Weather Widgets which is a similar idea. You have to embed JavaScript for that so I can't show it here. Looks like they have RSS feeds, and if you register you may be able to get more.

半葬歌 2024-07-24 18:42:26

https://weatherwidget.io/ 有一个新的交互式天气小部件生成器,

它是免费的,非常可定制,并且它创建的小部件是完全响应式的。

There is a new interactive weather widget generator at https://weatherwidget.io/

It is free, very customizable, and the widgets it creates are fully responsive.

菩提树下叶撕阳。 2024-07-24 18:42:26

如果您想拥有真正优秀的嵌入式天气软件,请使用 Wea​​ther Underground Api。 网站上的信息 (http://dutch.wunderground.com/weather/api/d /docs)非常好,有示例,并且有适合您自己开发的一切。

该信息基于原始数据,围绕它构建您自己的环境。 这意味着您必须构建外观,它们提供数据。

而且它是免费的!

If you wanna have real good embedded weather software use the Weather Underground Api. The information on the Website (http://dutch.wunderground.com/weather/api/d/docs) is very good, with examples and has everything for your own development.

The information is based on the raw data to build your own environment around it. That means you have to build the look-and-feel, they provide the data.

And it is free!!!

我ぃ本無心為│何有愛 2024-07-24 18:42:26

尝试了上述所有其他服务,但它们都无法在使用 HTTPS 的网站上运行。

我发现这项服务有效:

http://www.booked.net/widgets/weather

Tried all the other services above, but none of them worked on a site using HTTPS.

I found this service which worked:

http://www.booked.net/widgets/weather

梦旅人picnic 2024-07-24 18:42:26

我想出了一个技巧,可以在没有任何服务器端支持的情况下嵌入 Google 天气小部件,请参阅此处:

https://stackoverflow。 com/a/61980631/218294

I figured out a hack that enables to embed the Google weather widget, without any server-side support, see here:

https://stackoverflow.com/a/61980631/218294

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文