Step-by-Step: Yahoo Weather Integration in SharePoint 2010

Written by Denis Stadler on . Posted in SharePoint 2010

Some time ago I wrote a blog post which described how to add a Twitter feed in SharePoint 2010.

Using the same web part – XML Viewer Web Part it is possible to add Yahoo Weather forecast feed in SharePoint too.

For example the Helsinki weather forecast feed returns the following data:

The web address of the RSS feed is:

http://weather.yahooapis.com/forecastrss?w=565346&u=c

You can find full information about the Yahoo API here.

Just use the following XSL file (full download – Yahoo Weather RSS XML Web Part XSL) and the output will look like the one below.

Tags: ,

Trackback from your site.

Denis Stadler

I'm a technology enthusiast, with more than 10 years of experience in SharePoint and Dynamics CRM projects. To find more details about, please visit the about me page.

Comments (19)

  • Levent Curtasan

    |

    Hey Denis,

    Excellent post. You can also define a custom xmlns, xmlns:cns=”http://xsd_url”, and query your data using the custom xmlns.

    Reply

  • Clem

    |

    Whenever I use an xml web part, it just times out.
    Any ideas as to why?

    Reply

  • Brett

    |

    Hi,
    Can the Yahoo Weather webpart be set for each logged on User and remain set as permanent? So each time they visit the page, their weather is displayed each time. This would be great for users spread across multiple locations.

    Reply

    • Denis Stadler

      |

      I think that the easiest way to achieve this is to add as many web parts in the page as the number of weather areas. Then create SharePoint groups to correspond to each area and add the corresponding users.

      The final step is to set the correct Target Audience (in the web part settings, advanced) by choosing for each web part to be displayed, the right SharePoint Group.

      Reply

      • Brett

        |

        Thanks for the reply Denis, I think that could work for a few office locations but for a nation-wide company with people scattered to the four winds, I was thinking perhaps a custom list that holds each persons zip code when they enter it into the widget? So that when they return to the SharePoint site, their weather is displayed each time. The hunt continues :-)

        Reply

        • Denis Stadler

          |

          I didn’t know that you have so many different areas. Then I think a custom web part it will do the job.

          Basically you use an Active Directory attribute of the user, let’s say Zip/Postal Code. This attribute is mapped against a User Profile property, for example Office Location, but I could be as well a custom one.
          Then the weather should be a custom web part which uses the UserProfile Class.

          You could always do it with a custom list having the users and the Zip code, and read it from there, but I think that this information should be taken from AD if that is your primary data source when it comes to users.
          If you need a hand in building the custom code, let me know.

          Reply

  • Kevin

    |

    I may be missing something here, but I think there are some steps missing? Where does the rss link go? Also I’ve tried adding the code from the XSL to the XSL editor and my webpart still says , to add XM, open the tool pane and click on XML Editor.

    Reply

  • RyDer Knight

    |

    Dennis, is there any chance I can get the info in another language than English?
    Your solution is awesome, but I need it in Spanish.
    Any ideas?

    Reply

  • benjamin

    |

    umm How Do I change the temperature to Fahrenheit ???

    Reply

  • sreejitha

    |

    Hi Denis,

    Thanks for the solution. I was wondering if there is something to auto-detect the location of the user somehow, to modify the xml link?

    Reply

  • Alcatraz

    |

    I was wondering if there was a way to expand the RSS feed by default, as opposed to having to click to show the current conditions and forecast?

    Reply

    • Denis Stadler

      |

      It must be a way, to be honest I haven’t tried.

      Reply

Leave a comment

*