We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28215
    • 4,149 Posts
    This is an auto-generated topic for getFeed 1.0.0-rc1 by splittingred.

    Brief Description:

    A simple snippet to retrieve an RSS feed and iterate the feed items using a Chunk.

    • Fixed bug with output encoding

    See the official documentation at:
    http://svn.modxcms.com/docs/display/ADDON/getFeed
      shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
      • 3109 ☆ A M B ☆
      • 894 Posts
      Do you have any tips on how to make a template for the array results or how to select specific placeholders from the array?

      I’m trying to use this for twitter status.

      Thanks for the plugin.

      [UPDATE]

      Thanks to Jay Gilmore he directed me to tis tutorial on how to get Twitter statuses with getFeed here’s the link for an one else wondering how to accomplish this
        Benjamin Marte
        Interactive Media Developer
        Follow Me on Twitter | Visit my site | Learn MODX
        • 23491 ☆ A M B ☆
        • 1,056 Posts
        FYI, I have posted an issue on GitHub relating to XML parsing issue for the datafeed from a clean install of the latest WordPress (v.3.0.1)

        http://github.com/splittingred/getFeed/issues#issue/6

        ...Perhaps MagpieRSS does not support (or is not yet configured) to follow a 301 Redirect? (Not sure there is anyway around this for WordPress datafeeds?)
          Mike Reid - www.pixelchutes.com
          MODx Ambassador / Contributor
          [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
          ________________________________
          Where every pixel matters.
          • 28215
          • 4,149 Posts
          Not sure, but we can definitely look into it. Thanks for filing the issue. If you happen to figure it out before we do, feel free to fork getFeed and send a pull request, and we’ll add in the fix.
            shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
            • 23491 ☆ A M B ☆
            • 1,056 Posts
            Quote from: splittingred at Aug 16, 2010, 01:26 PM

            Not sure, but we can definitely look into it. Thanks for filing the issue. If you happen to figure it out before we do, feel free to fork getFeed and send a pull request, and we’ll add in the fix.

            Will do! Was just reading up on forking MODx Revolution from GitHub this morning: http://rtfm.modx.com/display/revolution20/Git+Installation wink
              Mike Reid - www.pixelchutes.com
              MODx Ambassador / Contributor
              [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
              ________________________________
              Where every pixel matters.
              • 23491 ☆ A M B ☆
              • 1,056 Posts
              Quick Update:

              After reviewing the modRSSParser class, I eventually came to the Snoopy class. As part of the default configuration, it looks like redirect support is enabled, with a limit of following up to 5 redirects:

              File: /core/model/modx/xmlrss/extlib/snoopy.class.php

              var $maxredirs = 5; // http redirection depth maximum. 0 = disallow


              As I traced through the code to see how/where any encountered redirects were handled, I soon realized that although the HTTP/1.0 301 Moved Permanently status was given, the resulting URI never changed? ...This caused Snoopy to continue looping until the maximum redirect tolerance was met, at which point it gives up trying to consume the feed.

              NOTE: I was able to take the WordPress feed and copy the XML into a MODx Resource (w/ XML content-type) and consume the feed without issues using getFeed, so it seems to have something to do with the 301 Redirect status and Snoopy’s handling of redirects. I even found where the status code was set and temporarily forced a "200 status", but the resulting rssCache file was incomplete as Snoopy never actually received the datafeed wink

              What I find interesting is that I am using a clean install of WordPress without FURLs (no mod_rewrite / 301, etc). When I hit the datafeed directly in my browser, I am never given the 301 Redirect, rather a 200 OK status...which makes me wonder how Snoopy is seeing anything differently?
                Mike Reid - www.pixelchutes.com
                MODx Ambassador / Contributor
                [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
                ________________________________
                Where every pixel matters.
                • 23491 ☆ A M B ☆
                • 1,056 Posts
                After a little more digging, I was able to track down the cause. It is related to the setting of port 80 in the HTTP request. When passing "HOST: localhost:80" the feed returns a 301, but when passing "HOST: localhost" it returns 200 OK and the feed is consumed as expected.

                I tested this by temporarily overriding the port just before the _httprequest() call in the fetch() method of "snoopy.class.php" (right before Line 156)

                if( $this->port == 80 ) $this->port = ''; // temporary override
                
                // no proxy, send only the path
                $this->_httprequest($path, $fp, $URI, $this->_httpmethod);
                


                NOTE: This is also happening on a similar Revo/WordPress setup, though it is a public domain and NOT ran against "localhost" ...
                  Mike Reid - www.pixelchutes.com
                  MODx Ambassador / Contributor
                  [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
                  ________________________________
                  Where every pixel matters.
                  • 18463
                  • 121 Posts
                  Martijn van Turnhout Reply #8, 16 years, 1 month ago
                  Hi,

                  as stated here, http://modxcms.com/forums/index.php/topic,23887.0.html, it would be great if getFeed could output multiple RSS feeds. That would be very useful.

                  Also, I’d love to know more about the Twitter possibilities regarding getFeed. For example, how can I accompany every tweet with a profile image? I’m looking for something similar like the Twitterfeed at http://www.supersteil.com/. Those kind of twitter feeds are getting more popular every day. I’d love to know how I can get that done with MODx.

                  Thanks for your reply and efforts in advance.
                    • 11055 ☆ A M B ☆
                    • 3,112 Posts
                    I have my site aggregating this forum’s recent topic rss, but the rss itself couldn’t handle one of the russian’s character, http://modxcms.com/forums/index.php/topic,53645.0.html (you can check it by clicking the RSS button on your browser’s address bar).

                    Rather than passing this error and continuing to the next feeding, getFeed threw error on my WEB page, not on the manager’s error log:

                    [2010-08-30 04:39:14] (ERROR @ /home/modxidco/public_html/core/model/modx/xmlrss/rssfetch.class.php : 242) User warning: MagpieRSS: Failed to parse RSS file. (not well-formed (invalid token) at line 19, column 277) [2010-08-30 04:39:14] (ERROR in getFeed @ /home/modxidco/public_html/core/cache/elements/modsnippet/8.include.cache.php : 48) Error parsing RSS feed at http://modxcms.com/forums/index.php?type=rss;action=.xml

                    I guess, you need to fix this so the error should be on the manager only.
                      Rico
                      Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
                      MODx is great, but knowing how to use it well makes it perfect!

                      www.virtudraft.com

                      Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

                      Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

                      Maintainter/contributor of Babel

                      Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
                      • 11858
                      • 130 Posts
                      Great multipurpose plugin Splittingred! Love being able to make any rss feed useable in MODx. One question though, does getFeed support namespaces? I’m trying to parse a Flickr feed with the tag

                      <media:thumbnail url="http://farm5.static.flickr.com/4085/5151167210_daebe0f3dc_s.jpg" height="75" width="75" />


                      what syntax would I have to use for the placeholder in the template?