We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14050
    • 788 Posts
    This is an auto-generated support/comment thread for WeatherX.

    Use this forum to post any comments about this addition or any questions you have regarding its use.

    Brief Description:
    Allows the easy output of XML feeds from Weather.com and Wunderground.com.
      Jesse R.
      Consider trying something new and extraordinary.
      Illinois Wine

      Have you considered donating to MODx lately?
      Donate now. Every contribution helps.
      • 15987
      • 786 Posts
      Jesse,
      Just out of curiosity, how come the feed from weather.com is cached in a file and not the one from wunderground? Is this something you are planning to add, I may take a shot at it if you don’t have time.

      Great snippet though, works great.

      Kyle
        • 14050
        • 788 Posts
        I think I didn’t cache it because the feeds were public and didn’t require a key (that could be shut down). By not placing it in the cache, you get up to the second weather, but for larger sites and as a good netizen, it is probably a good idea to cache both. I haven’t taken a look at this in quite awhile, but if there is a request for caching it, it shouldn’t be too hard :-D
          Jesse R.
          Consider trying something new and extraordinary.
          Illinois Wine

          Have you considered donating to MODx lately?
          Donate now. Every contribution helps.
          • 14050
          • 788 Posts
          I haven’t tested this, but I don’t see why it wouldn’t work, if you want to give it a whirl, let me know if it works :-D

            Jesse R.
            Consider trying something new and extraordinary.
            Illinois Wine

            Have you considered donating to MODx lately?
            Donate now. Every contribution helps.
            • 4971
            • 964 Posts
            Your snippet is very nice but I think it only works for the US, by inserting US cities and/or zip code.
            I’m in Mexico, any idea how should I modify the snippet to make it work for a foreign city?? Both
            wunderground and weather have available weather for Mexican cities, the problem that I find is that
            there is no way to call the feed cause both of them ask for the US zipcode, I have tried to input
            the "global station" id in wundeground at no avail and with weather.com I need the LocID which as
            stated in their guide uses a US city or a zipcode...

            any help will be greatly appreciated...

            Carlos
              Website: www.mercologia.com
              MODX Revo Tutorials:  www.modxperience.com

              MODX Professional Partner
              • 14050
              • 788 Posts
              Please let me know the URL of the feed for the Mexican city you want, for both Wunderground and/or Weather.com (You might want to send me the Weather.com one in PM as it contains your license and partner IDs).

              Also, you might want to take a look at FeedX as it can handle weather feeds quite nicely and has two sample templates for Weather.com and and Wunderground.

              Whichever route you choose, hopefully we can get it up and running for you.
                Jesse R.
                Consider trying something new and extraordinary.
                Illinois Wine

                Have you considered donating to MODx lately?
                Donate now. Every contribution helps.
                • 4971
                • 964 Posts
                Thanks for helping me jesster, the city is Cuernavaca, south of Mexico city.

                the wunderground RSS is:
                http://www.wunderground.com/auto/rss_full/global/stations/76726.xml?units=both

                76726 is the global station number for Cuernavaca airport (I think shocked, or wherever the station is).

                for weather.com:
                http://xoap.weather.com/weather/local/MXMS0064?cc=*&prod=xoap&par=[partner_id]&key=[license_key]

                again, MXMS0064 is MX=Mexico, MS=State or Morelos (where Cuernavaca is), 0064=must be the city station.

                I’ll send you my partner_id and license_key via PM...

                Thanks again for the help...


                  Website: www.mercologia.com
                  MODX Revo Tutorials:  www.modxperience.com

                  MODX Professional Partner
                  • 14050
                  • 788 Posts
                  I haven’t got your PM, but for Wunderground you should be able to just make the change to $wxWunderURL to get it to work.

                  Change:

                  //////// Some Constants
                  $wxUrl	 = 'http://xoap.weather.com/weather/local/';	// URL to xoap.weather
                  $wxUPDATE_CONSTANT = 600; //This is how often the weather will be updated.  DON'T CHANGE!
                  $wxNow = time(); //This allows us to see if we need to update variables
                  $wxWunderUrl = 'http://rss.wunderground.com/auto/rss_full/';


                  To:

                  //////// Some Constants
                  $wxUrl	 = 'http://xoap.weather.com/weather/local/';	// URL to xoap.weather
                  $wxUPDATE_CONSTANT = 600; //This is how often the weather will be updated.  DON'T CHANGE!
                  $wxNow = time(); //This allows us to see if we need to update variables
                  $wxWunderUrl = 'http://rss.wunderground.com/auto/rss_full/global/stations/';


                  That should do the trick :-D
                    Jesse R.
                    Consider trying something new and extraordinary.
                    Illinois Wine

                    Have you considered donating to MODx lately?
                    Donate now. Every contribution helps.
                    • 4971
                    • 964 Posts
                    Nope, I tried that before, I also thought that that was it...
                    nothing comes up when the URL is changed to global/stations...
                    I think it could be that the XML is different and your program can´t parse
                    it...
                    I´ll see that tomorrow...
                    Thanks anyway...

                    with weather.com, I also tried using MXMS0064 as the zipcode, so that when you
                    assemble the url comes exactly as the one used in the web site for CUernavaca,
                    but nothing changes in weather.txt.....?????
                      Website: www.mercologia.com
                      MODX Revo Tutorials:  www.modxperience.com

                      MODX Professional Partner
                      • 14050
                      • 788 Posts
                      Does it work at all when you use a United State’s based zip code?

                      Also, please look at FeedX. Anything you could have done in WeatherX, should be able to be accomplished in that snippet, and it is probably more efficient.

                      Jesse
                        Jesse R.
                        Consider trying something new and extraordinary.
                        Illinois Wine

                        Have you considered donating to MODx lately?
                        Donate now. Every contribution helps.