Sharepoint 2007 天气 Web 部件

发布于 2024-08-15 03:55:36 字数 167 浏览 2 评论 0原文

为 2007 sharepoint 实现天气 Web 部件的最佳方法是什么?我希望 Web 部件根据用户配置文件设置或 IP 范围自动选择正确的位置。

或者我应该使 Web 部件可连接到用户输入位置的另一个 Web 部件?

我希望得到有关如何执行此操作的指导。

非常感谢,

What is the best way to implement a weather web part for 2007 sharepoint. I want the web part to automatically select the correct location based on the users profile settings or maybe IP range.

Or should I make the webparts connectable to another webpart where the user enters the location?

I would appreciate guidance on how to do this.

Many Thanks,

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

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

发布评论

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

评论(2

醉城メ夜风 2024-08-22 03:55:36

可能不需要连接,所有逻辑都可以包含在 Web 部件中(也许还有自定义编辑器部件)。如果您使最终用户可以配置 Web 部件,那么它至少需要可个性化。

有些网站(如雅虎天气)具有 javascript API,可以根据邮政编码/位置获取天气信息。要获取用户的地理位置,您需要一个 IP 位置数据库。

您可以使用 MaxMind 的 GeoLite City 免费数据库,它将 IP 地址映射到地理位置。因为它是免费的,所以不精确到一米,但对于天气来说,我想说足够精确。该数据库每月更新一次,并提供二进制和 csv 格式(因此您可以将 csv 导入 SQL 数据库)。更多信息此处

一旦您获得了地理位置,您就可以使用雅虎的天气 API 来获取信息。然后解析结果并设置样式。

PS GeoLite City 只是一个例子,那里有类似的产品,这只是我在谷歌上找到的一个,我与他们没有任何关系或类似的东西。

A connection is probably not needed, all logic could be contained in the webpart (plus maybe custom editorpart). If you make the webpart configurable by end users it needs to be personalizable at the least.

There are sites (like Yahoo weather) that have javascript API's to get weather info based on zipcode / location. To get a user's geographical location, you need an IP to location database.

You could use MaxMind's GeoLite City free database, it maps IP addresses to geographical locations. Because it's free it is not accurate up to a meter, but for weather i'd say accurate enough. The database is updated monthly and comes in both binary and csv format (so you could import the csv into a SQL database). More info here.

Once you have a geographical location you can use Yahoo's weather API to get the info. Then parse and style the result.

P.S. GeoLite City is just an example, there are similar products out there, this is just the one I found googling, I Have no affiliation with them or anything like that.

○闲身 2024-08-22 03:55:36

最简单的方法是简单地添加页面查看器 Web 部件,并将其用作链接:

http://www.bing.com/webslices/answer.aspx?q=weather&a=WeatherAnswer&s=Weather&form=IE8WSV

将显示当前用户通用IP地址区域的天气情况。如果您愿意,您可以自定义链接以包含特定的邮政编码,方法是将“q=weather”更改为“q=weather XXXXX”,其中 XXXXX 是邮政编码。

第二个最简单的方法是使用内容编辑器 Web 部件,并选择 Google 小工具上的任何天气小工具。在 Google 小工具区域找到您喜欢的小工具后,单击“获取代码”,然后将代码复制并粘贴到内容编辑器 Web 部件的“源代码编辑器...”区域。

如果您想要一个完整的免费解决方案,您可以使用他们捐赠给 SharePoint 社区工具包项目的 Bamboo Solutions 天气 Web 部件。

我会发布一个指向该项目的链接,但这里内置的垃圾邮件防护限制我每个答案只能有一个链接。在谷歌上搜索 CKS Weather,您将获得第一次点击的链接。

The simplest way is to simply add in a Page Viewer web part, and use this for a the link:

http://www.bing.com/webslices/answer.aspx?q=weather&a=WeatherAnswer&s=Weather&form=IE8WSV

That will display the weather for the current user's general IP address area. You can customize the link to include specific zip codes, if you like, by chaing the "q=weather" to "q=weather XXXXX", where XXXXX is the zip code.

The next simplest is to use a Content Editor Web Part, and choose any of the weather gadgets on Google Gadgets. Once you find one you like in the Google Gadget area, click on "Get the Code", and then copy and pase the code into the "Source Editor..." area of the Content Editor Web Part.

If you would like a finished, free solution, you can use the Bamboo Solutions weather web part that they donated to the Community Kit for SharePoint project.

I'd post a link to that project, but the built-in spam protection here limits me to one link per answer. Do a google search for CKS Weather, and you will get the link from the first hit.

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