We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4971
    • 964 Posts
    THanks Jesse,

    I read most of the FeedX thread and it sounds really great.

    I installed FeedX on my site and then I installed your weather.com contibution
    to my website. I put my partner number and key as you indicate, but I get nothing in
    my site... strange...

    any ways to debug it?

    btw I am using a US zipcode first to make it work
      Website: www.mercologia.com
      MODX Revo Tutorials:  www.modxperience.com

      MODX Professional Partner
      • 4971
      • 964 Posts
      Progress here... the &preset has to equal to rss, not to weather.com, that is already indicated in
      the URL. I also activated cache and debug on FeedX, great stuff!!

      According to the debugger I get the RSS feeds alright, the US ones and the Mexico ones, my problem
      now is that nothing appears in the web page. I have a feeling that somehow I need to write a chunk
      or something with the different templates and put it as a parameter in the FeedX call...

      I updated your templates for weather.com but they do not do anything... so I will keep searching...

      PS Maybe we should move this to the FeedX thread... how do we do that?
        Website: www.mercologia.com
        MODX Revo Tutorials:  www.modxperience.com

        MODX Professional Partner
        • 14050
        • 788 Posts
        Actually. The &preset parameter is used to call the templates in the tpl folder. You need to have &preset set to weather.com. With the preset set as weather.com, post your debug code over in the FeedX support thread, and we will debug from there.
          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
          Yes, I am an idiot... when I changed it to RSS I could see the feed in the debugger but it did not
          connect to the tpl’s as it should. I had to change it to weathercom, somehow with the dot it was
          not working for me.

          Now everything is OK... I am now working on the tpl’s...
          how do I apply the CSS? do I just include new classes in the tpl’s?? I guess so...

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

            MODX Professional Partner
            • 14050
            • 788 Posts
            Well you just add the css in your .css file as it will output whatever classes/html markup you want.
              Jesse R.
              Consider trying something new and extraordinary.
              Illinois Wine

              Have you considered donating to MODx lately?
              Donate now. Every contribution helps.
              • 8147
              • 6 Posts
              On a side note i live in whitehorse, yukon, canada.... i changed the url as suggested by the author, worked like a charm for me instantly.

              I really like this snippet because of its simplicity, thank you so much...I owe the modx community, writers, and members so much...i thank you all and if there is anything else i can do to help, please contact me.

              Modx friggin rocks, it truly is some of the nicest/most flexible/ easy to use software ive ever used.

              Not an easy combination to come up with, heh.

              DJ

              New West Technologies
                • 14050
                • 788 Posts
                It is hearing stuff like this that motivates us to write code smiley
                  Jesse R.
                  Consider trying something new and extraordinary.
                  Illinois Wine

                  Have you considered donating to MODx lately?
                  Donate now. Every contribution helps.
                  • 36933
                  • 35 Posts
                  I hope someone is still hanging around here as I need some help.

                  I need to display the weather for two different cities on the same page ... hmmm I thought, I will just make two different chunks with different postcodes in them and call each one from the page. Well that didn’t work. They both work if I call one chunk on one page and the other chunk on another page, but I get the following error when they are on the same page.

                  Fatal error: Cannot redeclare setplaceholders() (previously declared in
                  public_html/modx/manager/includes/document.parser.class.inc.php(766) : eval()’d code:178) in public_html/modx/manager/includes/document.parser.class.inc.php(766) : eval()’d code on line 186


                  I am a little confident in what I am doing with the code for some snippets so I made a duplicate of the weatherX snippet and started trying to rename the placeholders. This did not work at all, still get the same error, but it does change line numbers, so I figure I am getting somewhere. After changing prettymuch every variable in the code it still would not work.

                  My question is obviously .. how do I do this? Has someone already done it?

                  please help me.

                  thanks

                  Brad
                    • 14050
                    • 788 Posts
                    The problem is that when I coded this, I took the lazy way of declaring the function inside the snippet. As such, when you call the snippet twice, it tries to declare the function twice, which PHP finds unacceptable.

                    Backup your current version and try the version I just attached. Upload the include file to assets/snippets/WeatherX, and paste the new WeatherX.php in as your snippet. If icons weren’t working, upload the "graphics" folder, as well.

                    Although this snippet works easier out of the box, it is really deprecated in favor of FeedX.

                    http://modxcms.com/forums/index.php/topic,12657.0.html

                    FeedX is essentially an XML parser that is super easy to template. As such, you can access weather provided by Yahoo, Weather.com, or Wunderground.

                    http://modxcms.com/forums/index.php/topic,12657.0.html

                    It already has default presets/templates for Wunderground and Weather.com, and I attached a template for Yahoo.com (http://cmssandbox.com/MODx095/index.php?id=57). Read through that entire thread, it is very informative. Also it provides the possibility of doing multiple days (http://cmssandbox.com/MODx095/index.php?id=83) and many other neat things.
                      Jesse R.
                      Consider trying something new and extraordinary.
                      Illinois Wine

                      Have you considered donating to MODx lately?
                      Donate now. Every contribution helps.
                      • 36933
                      • 35 Posts
                      Thanks for your quick reply Jesse and I am sorry it took a while for me to get back to you.

                      There seems to be some issue still with this revised snippet, in that it doesn’t error when calling it twice but it just displays the same weather twice. Not being a confident programmer I don’t exactly know what is going wrong but I think it is only setting one set of placeholders and just returning the same set twice.

                      Another problem seems to be when I am taking some of the items from the chunk the placeholders seem to get messed up. The time/date will display in the image tag and other strange things.

                      I am using trying to use it for international weather from wunderground, and it also seems that the xml feed may vary slightly from the US feed this snippet is set up for.

                      Anyway I understand you probably don’t want to do much about this as the snippet is depreciated in favor of FeedX, but I have tried to get the required info out of FeedX and as well as struggling with the template concept and extracting the required fields. It also seems to have a problem when calling the weather twice on the one page, so maybe it is harder to do than what the idea seems.

                      Basically I am in Australia and I am building a greek website so I want to display the weather in Athens, Greece and Adelaide, Australia.

                      Any further help will be appreciated.

                      regards,

                      Brad