We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40508
    • 4 Posts
    Hi There,

    I am using the RSS import snippet in MODx Evolution. It works very well indeed - provided my site is online and connected to the internet. If it is protected by a firewall or the site providing the RSS feed can otherwise not connect, I get the following error:

    [quote]« MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »
     
    PHP error debug
      Error: 	fsockopen() [function.fsockopen]: unable to connect to www.bom.gov.au:80 (Connection refused)	 
      Error type/ Nr.: 	Warning - 2	 
      File: 	/Applications/MAMP/htdocs/ses/manager/media/rss/extlib/Snoopy.class.inc	 
      Line: 	1142	 
      Line 1142 source: 	)) 	 
     
    Parser timing
      MySQL: 	0.0120 s	(13 Requests)
      PHP: 	0.0970 s	 
      Total: 	0.1090 s	 [/quote]


    I am not bothered by the message - I get it, it can't connect. What I am bothered by is that this message is then all that is visible on my site - and as it is on the home page, that is a big issue.

    I have done google searches looking for a better way to handle this error but could not find any advice - most people just wanted it to stop having the problem. I don't mind that sometimes it can't connect - I just want to display a message in place of the feed saying RSS feed unavailable or something like that rather than have the first page of my site just disappear until it can connect again.

    Does anyone know if it is possible to add something to the snippet or Snoopy.class.inc that will allow my site to handle this message more elegantly?

    Thank you very much,

    Kathy smiley [ed. note: kathyc last edited this post 10 years, 5 months ago.]
      • 40508
      • 4 Posts
      I posted too soon. Searching from a different perspective yielded the simple answer: put a @ in front of the fsockopen call and the whole problem goes away. Simple error handling stuff.

        • 45353
        • 12 Posts
        Is there a way to access and use this package currently? I can not find it when searching for packages within MODX, and the zip file provided at the link below is not the proper transport package for MODX Revolution:

        http://modx.com/extras/package/rssimport

        Thanks..
          • 13226
          • 953 Posts
          It's an "Evo" snippet, it's not for Revo

          You might want to take a look at GetFeed or try searching the Revo extras for RSS
            • 45353
            • 12 Posts
            Thanks iusemodx! I have tried searching Revo extras for RSS but have had no luck. Our team currently uses getFeed, but what we are looking for is a tool that is able to aggregate and display RSS feeds as well. Do you know if this is possible with getFeed, or something else?
              • 13226
              • 953 Posts
              I am not a Revo expert and as such probably can't answer your question to the full

              But, the following may help you:

              getFeed documentation

              getResources - Building an RSS feed

              You may also want to take a quick look here