We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24731 ☆ A M B ☆
    • 211 Posts
    Yes I am, here is my call:

    [!FeedX? &url=`http://xoap.weather.com/weather/local/DRXX0009|xq|cc|xe|*|xa|prod|xe|xoap|xa|par|xe|***|xa|key|xe|***|xa|dayf|xe|3` &preset=`weather.com` &debug=`1`!]


    Thanks,
    Jose
      • 14050
      • 788 Posts
      Just a quick note. You will want to edit your previous post to blank out your partner id and key :-D Or if a moderator can do that, it would be nice. Later tonight I will take a look at what you are trying to do, if you haven’t already figured it out by then.
        Jesse R.
        Consider trying something new and extraordinary.
        Illinois Wine

        Have you considered donating to MODx lately?
        Donate now. Every contribution helps.
        • 24731 ☆ A M B ☆
        • 211 Posts
        Quote from: charliez at May 07, 2007, 05:25 PM

        Mmmm... weird...

        1) Can you post your FeedX call ?
        2) are you using the debugger?

        Reading the weather.com guide, you have to indicate the day and the part of day.
        As you can read, the day has an argument d="1" or d="0", and part has also an
        attribute p="n" or p="d"... seems like it is calling everything as it does not know
        which one to send...

        You also have to tell FeedX and weather.com to have &dayf=2 so the forecast
        only includes 2 days... (I think you are already doing this)

        THE problem is that I do not know how to access the attributes! The best way will
        be to check the debugger to see 1) what and in what order is the feed sending the
        forecast info and 2) see the tpl builder to see if it is giving you a way to access the
        attributes...

        let me know...

        I am attaching my debug HTML so you can have a look. I completely understand the situation, just like you, I just do not understand how I can access those variables so I can format the template accordingly and I have tried practically everything already sad.

        Here is the link to the feed it is processing:

        http://xoap.weather.com/weather/local/DRXX0009?cc=*%E2%88%8F=xoap&par=****&key=****&dayf=3

        I tried a different approach, making three different feedx requests with different parameters to select different results of the files, but when it reaches the images (day and night options) I reach the same problem again. The best solution is if there was a way to access those variables in the feed results so I could code the templates correctly.
          • 24731 ☆ A M B ☆
          • 211 Posts
          Quote from: jesster444 at May 07, 2007, 06:03 PM

          Just a quick note. You will want to edit your previous post to blank out your partner id and key :-D Or if a moderator can do that, it would be nice. Later tonight I will take a look at what you are trying to do, if you haven’t already figured it out by then.

          Thanks, I edited both posts to remove the partner ID.

          I appreciate any assistance you can offer. We are basically down to one question:

          How can we template using the variables contained in the feed so we can select which section to output.

          So if the feed includes:

            <dayf>
              <lsup>5/7/07 1:36 PM Local Time</lsup>
              <day d="0" t="Monday" dt="May 7">
                <hi>N/A</hi>
                <low>74</low>
                <sunr>6:08 AM</sunr>
                <suns>7:02 PM</suns>
                <part p="d">
                  <icon>44</icon>
                  <t>N/A</t>
                  <wind>
                    <s>N/A</s>
                    <gust>N/A</gust>
                    <d>N/A</d>
                    <t>N/A</t>
                  </wind>
                  <bt>N/A</bt>
                  <ppcp>40</ppcp>
                  <hmid>N/A</hmid>
                </part>
                <part p="n">
                  <icon>47</icon>
                  <t>Scattered T-Storms</t>
                  <wind>
                    <s>8</s>
                    <gust>N/A</gust>
                    <d>85</d>
                    <t>E</t>
                  </wind>
                  <bt>Sct T-Storms</bt>
                  <ppcp>40</ppcp>
                  <hmid>90</hmid>
                </part>
              </day>
              <day d="1" t="Tuesday" dt="May 8">
                <hi>89</hi>
                <low>74</low>
                <sunr>6:08 AM</sunr>
                <suns>7:03 PM</suns>
                <part p="d">
                  <icon>38</icon>
                  <t>Scattered T-Storms</t>
                  <wind>
                    <s>13</s>
                    <gust>N/A</gust>
                    <d>111</d>
                    <t>ESE</t>
                  </wind>
                  <bt>Sct T-Storms</bt>
                  <ppcp>60</ppcp>
                  <hmid>79</hmid>
                </part>
                <part p="n">
                  <icon>47</icon>
                  <t>Scattered T-Storms</t>
                  <wind>
                    <s>9</s>
                    <gust>N/A</gust>
                    <d>85</d>
                    <t>E</t>
                  </wind>
                  <bt>Sct T-Storms</bt>
                  <ppcp>60</ppcp>
                  <hmid>88</hmid>
                </part>
              </day>


          How can I let the template know I want to output only: day d="0" and inside it, part p="n" and so on.

          Thanks again,
          Jose R. Lopez
            • 4971
            • 964 Posts
            In the debugger tree, it appears that the placeholders for [+DAY+] are
            [+HI+] [+LOW+] [+SUNR+] [+SUNS+] [+PART.P+] [+PART.1.P+] ...

            as you can see, PART.P is d... they are accessing the attribute p="d" and
            PART.1.P is n... so...

            so probably you can access the day by DAY.D, DAY.1.D, etc...
            so by indicating DAY.1.D and PART.1.P you are telling to show the evening forecast for tomorrow!!!

            Just thinking out loud... give it a try... I am out of ideas...
              Website: www.mercologia.com
              MODX Revo Tutorials:  www.modxperience.com

              MODX Professional Partner
              • 24731 ☆ A M B ☆
              • 211 Posts
              Quote from: charliez at May 07, 2007, 07:29 PM

              In the debugger tree, it appears that the placeholders for [+DAY+] are
              [+HI+] [+LOW+] [+SUNR+] [+SUNS+] [+PART.P+] [+PART.1.P+] ...

              as you can see, PART.P is d... they are accessing the attribute p="d" and
              PART.1.P is n... so...

              so probably you can access the day by DAY.D, DAY.1.D, etc...
              so by indicating DAY.1.D and PART.1.P you are telling to show the evening forecast for tomorrow!!!

              Just thinking out loud... give it a try... I am out of ideas...


              Yeah, I had already tried that. Works good for the days, I can access the days names individually without problems, but that’s not the problem, the problem is loading the values which belong to each day specifically.

              Since Hi, Low, and all other values are contained within Day, I need to call them through a file from Day, when I do this, that template file loops through all available data, so it repeats itself for all three days in the forecast.

              I need to either be able to call each day individually by its own template tag or be able from inside the looping template insert all the other variables I need to complement the structure in the HTML that is required, but since the relationship between children works (from what I’ve learned) in such a limited way, I am stucked sad. I am not saying that the snippet is not flexible, I am sure it is, I just have not been able to figure out how to output this, and have not been able to find accurate documentation on how to build the templates, so all I’ve done is pretty much guessing, trial and error.

              Thank you for your time.

              Jose R. Lopez
                • 14050
                • 788 Posts
                Alright...I am home and will take a look. Before looking at it though, it sounds like PHx might be the answer. I’ll let you know what I will find out.
                  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 think this is what you are trying to accomplish:

                  http://cmssandbox.com/MODx095/index.php?id=83

                  To accomplish this, you have to take advantage of FeedX’s "offset" and "limit" capabilities.

                  outer
                  {{WEATHER->inner}}


                  inner
                  {{DAYF->dayf}}


                  dayf
                  <h1>[+DAY.T+]</h1>
                  {{DAY(1)->firstDay}}
                  <h1>[+DAY.1.T+]</h1>
                  {{DAY(1,1)->secondDay}}
                  <h1>[+DAY.2.T+]</h1>
                  {{DAY(1,2)->thirdDay}}


                  firstDay
                  <p>{{PART(1,1)->part}}<b>High:</b> [+HI+]<br />
                  <b>Low:</b> [+LOW+]</p>


                  secondDay
                  <p>{{PART(3,1)->part}}<b>High:</b> [+HI+]<br />
                  <b>Low:</b> [+LOW+]</p>


                  thirdDay
                  <p>{{PART(5,1)->part}}<b>High:</b> [+HI+]<br />
                  <b>Low:</b> [+LOW+]</p>


                  part
                  <img src="http://image.weather.com/web/common/wxicons/52/[+ICON+].gif"/>


                  Hope that is what you were looking for.



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

                    Have you considered donating to MODx lately?
                    Donate now. Every contribution helps.
                    • 24731 ☆ A M B ☆
                    • 211 Posts
                    Yes, that’s perfect, exactly what I needed.

                    I think it will be very helpful for others in the future if there would be a How to for template creation for this snippet. I’ll be happy to help in anything that I can.

                    Regards,
                    Jose R. Lopez
                      • 14050
                      • 788 Posts
                      Feel free to add any of this to the Wiki.
                        Jesse R.
                        Consider trying something new and extraordinary.
                        Illinois Wine

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