We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26140
    • 11 Posts
    I am stumped:
    How do I complete this for FeedX??

    [!FeedX? &url=`http://modxcms.com/forums/index.php?sa=recent;type=rss2;action=.xml&limit=10;board=1|
      • 26140
      • 11 Posts
      Looks like I answered my own question after reading other postings. Thanks for all the good postings regarding FeedX. VERY NICE - FeedX is GREAT and looks to be very useful!

      FeedX 0.1.2
      URL http://modxcms.com/forums/index.php?sa=recent;type=rss2;action=.xml&limit=10;board=4
      Cache Type Data caching
      Cache Time 3600 seconds
      Preset rss

      [!FeedX? &url=`http://modxcms.com/forums/index.php|xq|sa|xe|recent;type|xe|rss2;action|xe|.xml|xa|limit|xe|30;board|xe|4` &preset=`rss` &cacheTime=`3600` &debug=`1`!]
      THIS WORKS!
      I can read the individual records of the feed in the Debug popup window.

      Created a chunk: FeedX_MODx_Templates_NEWS_FEED
      <h3>MODx Forum Template News:</h3>
      <p>
      [!FeedX? &url=`http://modxcms.com/forums/index.php|xq|sa|xe|recent;type|xe|rss2;action|xe|.xml|xa|limit|xe|30;board|xe|4` &preset=`rss` &cacheTime=`3600` &debug=`0`!]
      </p
        • 26140
        • 11 Posts
        How do I use Feedx to only retrieve 1 record from the ATOM feed of blogspot? All my attempts are failing...
          • 29319
          • 37 Posts
          Hi guys, My feed is failing. Here is the code i am using [!FeedX? &url=`http://noisymime.org/asx/s.php?code[]=tls&` &preset=`rss` &caheTime=`3600` &debug=`1`!] However it says

            Error: 	file_get_contents(http://noisymime.org/asx/s.phpcode[) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found 	 
            Error type/ Nr.: 	Warning - 2	 
            File: 	C:\xampp\htdocs\assets\snippets\FeedX\classes\feedx.class.inc.php	 
            Line: 	291	 
            Line 291 source: 	$xml = file_get_contents($this->config['url']); 	 
           
            • 22770
            • 285 Posts
            Well, you’ve spelled ’cacheTime’ wrong, but I wonder if the actual problem is having the ’?’ in the URL?
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              You can’t have ?, =, & in snippet calls. Use |xq|,|xe|,|xa| instead.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 29319
                • 37 Posts
                Hi guys thanks for that.
                [!FeedX|xq| |xa|url=`http://noisymime.org/asx/s.php|xq|code[]=tls|xa|`|xa|preset=`rss` |xa|cacheTime=`3600`|xa|debug=`1`!]
                however now nothing is displayed (but i don’t get any errors either)
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  [!FeedX? &url=`http://noisymime.org/asx/s.php|xq|code[]|xe|tls|xa|` &preset=`rss` &caheTime=`3600` &debug=`1`!]

                  You can’t have ?, =, & in the snippet parameter values. That’s because these are used as delimiters in the snippet tag. So only replace them in the parameter values (between `...`)
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                    • 22825
                    • 8 Posts
                    Maybe I’m crazy, but it _looks_ like FeedX sorts the item by first coercing to a string. So, my random list of feed elements gets sorted with items published on Wednesday when I use "&sortElements=`ITEM(PUBDATE DESC)`".

                    Is that possible? If it’s really doing that, how can I make it really sort by date? huh
                      • 22825
                      • 8 Posts
                      Quote from: pauljwelty at Aug 24, 2009, 12:46 PM

                      Maybe I’m crazy, but it _looks_ like FeedX sorts the item by first coercing to a string. So, my random list of feed elements gets sorted with items published on Wednesday when I use "&sortElements=`ITEM(PUBDATE DESC)`".

                      Is that possible? If it’s really doing that, how can I make it really sort by date? huh

                      Ok, I think it was really doing that. I hacked this little fix for my case, and so far it seems to work. This goes into the feedx.class.inc.php:

                      // Populate sortable array
                      			foreach ($data as $key => $item)
                      				if ($item['name'] == $element && is_array($item['children']))
                      					foreach ($item['children'] as $s_item)
                      						if ($s_item['name'] == $child)
                      						{
                      							// PAUL's stuff starts
                      							if ($child=='PUBDATE')
                      							{
                      								$temp2 = isset($attr) ? $s_item['attr'][$attr] : $s_item['value'];
                      								$sort[$key] = date("U",strtotime($temp2));
                      								break;
                      							} else {
                      							// PAUL's stuff ends
                      							$sort[$key] = isset($attr) ? $s_item['attr'][$attr] : $s_item['value'];
                      							break;
                      							// PAUL's stuff starts
                      							}
                      							// PAUL's stuff ends
                      						}