ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Anyone know of a weather addon that will allow you to display weather from a zip code in a custom field?

February 28, 2008 8:06pm

Subscribe [1]
  • #1 / Feb 28, 2008 8:06pm

    Deron Sizemore

    1033 posts

    I’d like to display like a three day weather forecast for a location based on the zip code inside of a custom field.

    Anyone seen an EE addon that will do this?

  • #2 / Feb 29, 2008 12:02pm

    Paul Burdick

    480 posts

    If you go to the EE.com Add-On Library and search for ‘weather’ there are two there.  Both a couple years old, so I am not sure if they will still work but you might want to start there.

  • #3 / Feb 29, 2008 12:52pm

    Deron Sizemore

    1033 posts

    Hey Paul,

    Yeah I noticed those two there in the add on library but it seems those two only allow you to output weather based on a station location code rather than a zip code…

  • #4 / Feb 29, 2008 1:36pm

    Paul Burdick

    480 posts

    Hm, indeed.  A quick search shows me there are a few possibilities.  Could use the Yahoo Weather API, which allows you to get an RSS feed from a URL containing the zip code, so you could actually use the Magpie plugin.  A few other sites will give you an XML file, which could be parsed by EE’s XMLParser library in a plugin, but I do not know of an EE plugin that exists currently to do that.

  • #5 / Feb 29, 2008 2:05pm

    Deron Sizemore

    1033 posts

    Seems like the Yahoo API might work. I’m still not sure though. Let me explain what I’m trying to do and maybe you can give me better idea as to if it’s possible with the Yahoo API and Magpie.

    I’ve got a golf site in development which will have a a courses section which will list every course in the state. I’ll create a weblog where each weblog entry will hold information about the course. I’ll have a custom field which will hold the zip code of the course and I’d like to display the weather forecast for this location.

    So… not sure if that’s possible with this or not? I read over the summary at the Yahoo API link, but it’s not immediately obvious to me if this is possible?

  • #6 / Feb 29, 2008 2:19pm

    Paul Burdick

    480 posts

    Yes, it would be possible.  http://weather.yahooapis.com/forecastrss?p={custom_field_variable_for_zipcode} would be put into the Magpie plugin for the feed URL and it would have a description field containing the current weather.

    And, honestly, you do not even really have to use EE for this.  If you do a Google search for “weather widget” there are sites that provide other tools.  Even the Weather Channel has something.

  • #7 / Feb 29, 2008 2:39pm

    Deron Sizemore

    1033 posts

    Ah, I see. Thanks Paul, I’ll give that a try and see how it works out.

  • #8 / Mar 28, 2008 1:03pm

    Deron Sizemore

    1033 posts

    Paul,

    I’ve given the yahoo weather api a try using magpie and it will work, but I’m a little stuck now on what I need to do to actually display the current conditions and forcast?

    Here’s what I’ve got in my template:

    {exp:magpie url="http://weather.yahooapis.com/forecastrss?p={courses-zip}" limit="1" refresh="60"}
    {magpie:items}        
    {magpie:title}
    {/magpie:items}
    {/exp:magpie}

    On this page: http://developer.yahoo.com/weather/ I see a lot of channel elements I can use to customize this widget, but I’m not sure how to use them. For example, I see:

    yweather:condition

    but when I use this tag:

    {magpie:yweather:condition}

    inside of the magpie:items tag pair, it does nothing. So, I’m not sure what else I need to add/do to get this to show up? Little confused.

    Thanks

  • #9 / Apr 01, 2008 3:21pm

    Deron Sizemore

    1033 posts

    Hey Paul,

    I got this figured out I believe. Works good with Yahoo weather and Accuweather. I missed the part where you said I would need the description field for the current weather. Once I added the {magpie:description} the current conditions and forecast started showing up.

  • #10 / Apr 01, 2008 10:46pm

    Deron Sizemore

    1033 posts

    Actually, if you’re still hanging around reading Paul, I have another question. I visited this page: http://www.accuweather.com/rss-center.asp to set up the RSS feed for Accuweather. The description says that it should be the current weather plus the two day forecast. Below you can see the code I’m using for the Magpie plugin. The problem is that it doesn’t display the two day forecast. I’m assuming there is another tag I need to add to display this? Just not sure what that other tag is.

    Thanks

    {exp:magpie url="http://rss.accuweather.com/rss/liveweather_rss.asp?metric=0&locCode;={courses-zip}" limit="1" refresh="60"}
    {magpie:items}        
    {magpie:description}
    {/magpie:items}
    {/exp:magpie}
  • #11 / Apr 02, 2008 1:00am

    Paul Burdick

    480 posts

    Could you give me an example URL with the variable {courses-zip) replaced.  Oh, and I am traveling across country right now, so I will be a bit slow to respond until I get to my destination.

  • #12 / Apr 02, 2008 1:31am

    Deron Sizemore

    1033 posts

    Oh, no problem Paul. This by no means is an urgent matter. 😊 I appreciate your time and taking a look.

    Here is an example URL with the zip variable replaced with a Lexington, KY zip: http://rss.accuweather.com/rss/liveweather_rss.asp?metric=0&locCode;=40509

  • #13 / Apr 02, 2008 10:12am

    Deron Sizemore

    1033 posts

    Hey Paul,

    I was messing around with this again and it dawned on me that I was using limit=“1” in the magpie tag, which would indicate why it was only showing one day. I changed that to limit=“3” and now it shows three days, so it seems that’s all I needed to do…

    thanks again.

  • #14 / Apr 02, 2008 10:15am

    Sue Crocker

    26054 posts

    Deron, do I really care about the weather two days ago? 😊 Wouldn’t I rather see two days predicted weather?

    But thanks for the thread, I implemented Yahoo Weather on a few sites today.

  • #15 / Apr 02, 2008 10:39am

    Deron Sizemore

    1033 posts

    Deron, do I really care about the weather two days ago? 😊 Wouldn’t I rather see two days predicted weather?

    But thanks for the thread, I implemented Yahoo Weather on a few sites today.

    I think I may have misspoke at some point in this thread? I wasn’t looking to get the weather from two days ago, just the current weather and then the following two days. 😉

    What did I say to give you the crazy idea I wanted weather from two days ago?  🐛  :cheese:

    Is this how you’re using it?:

    {exp:magpie url="http://weather.yahooapis.com/forecastrss?p={courses-zip}" limit="1" refresh="60"}
    {magpie:items}        
    {magpie:description}
    {/magpie:items}
    {/exp:magpie}
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases