We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9207 ☆ A M B ☆
    • 2,475 Posts
    Can someone point me to some resources that might enable me to search an XML feed? I want to publish relevant news articles on one of my sites. I can already subscribe to the RSS feeds from a bunch of sites, but often I end up with ALL of the stories instead of only a few of them that match a couple keywords. If Google had a way of creating a feed just from a keyword, it’d be nice... something where you could just reference the xml source as something like (i’m just making this up):

    http://www.google.com/feed.rss?site=nytimes.com&search_terms=Denver,Rockies


    Does MODx have any modules that help read through XML feeds and search through the results? I’ve had to code this type of thing manually in Perl before, and if I can avoid doing it again in PHP it’s be much simpler...

    Thanks for any input!
      • 9207 ☆ A M B ☆
      • 2,475 Posts
      Ah, I’ve already found something on Google... you can use the following type url to grab a feed for specific search results:
      http://news.google.com/news?client=safari&rls=en&q=denver&oe=UTF-8&um=1&ie=UTF-8&hl=en&ei=QViTSbySJInOsAPihdSoCw&resnum=4&nolr=1&output=rss

      Where "denver" is my search term. Don’t know if this will work to publish on a site ... I"m seeing the bit there about "client=safari" and I’m wondering if there’s an expiration for this (is that ’ei’ bit a session)? But I’ll play around with it.

        • 9207 ☆ A M B ☆
        • 2,475 Posts
        Ok, I figured this out... you can get the RSS feed created by a Google search... you can also create a Google Alert for that feed, although that posts stories as they happen, which may result in a blank feed for most of the time depending on your search term.

        E.g.
        1. type in a search term in Google
        2. Click on the "news" results (the resulting page has an RSS viewing option)
        3. View the source of the page and search for RSS... find the feed url, something like this:
        http://news.google.com/news?ie=UTF-8&oe=utf8&q=YOUR_TERM_HERE&hl=en&gl=us&nolr=1&output=rss

        4. You can use that URL in the NewsParserX Snippet:
        http://modxcms.com/NewsParserX-601.html
        Just make a couple alterations to the URL as listed in the Wiki:
        http://wiki.modxcms.com/index.php/RSS


          • 16034
          • 107 Posts
          Feedrinse is a free service that let’s you take one or more RSS feeds, apply a filter, and access the result as an RSS feeds.

          I use it for some news feeds that I read. (Though not in MODx, but I don’t see why it shouldn’t work.)

          http://feedrinse.com/
            MODx snippet-glossary 101:
            Ditto = Content Lister -- Wayfinder == Menu Builder -- Jot = Comment Control
            • 9207 ☆ A M B ☆
            • 2,475 Posts
            Thanks Kleist... FeedRinse ALMOST rocks... I’m not really jazzed about the OPML format... that might be usable, but I can’t reference it directly in the Snippet. I might be able to import it into a feed-reading program, then generate a feed from that program, and reference THAT feed in the Snippet, but that’s just so strung out...

            I made a post about it:
            http://www.tipsfor.us/2009/02/12/feedrinse-search-and-consolidate-your-rss-feeds/
              • 16034
              • 107 Posts
              Just click the nice little icon on the left of your channels name to get the rinsed feed.
                MODx snippet-glossary 101:
                Ditto = Content Lister -- Wayfinder == Menu Builder -- Jot = Comment Control