C# – Sharepoint 2007 weather web part

csharepoint-2007web-parts

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,

Best Answer

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.

Related Topic