HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS. ocPortal 9 is superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


RSS news block

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#29388 (In Topic #6760)
Avatar

Community saint

Hi,

I tried to setup rss feeds block. Everything works ok for any feed I tried, except Thorn Tree Travel Forum - Lonely Planet
After I load this feed, my page doesnt open.
I can even have lots of different feeds in one page, but it stops when lonelyplanet is loaded

Proxy server error

Is it because of the feed itself, or some bug in the system?
Back to the top
 
Posted
Rating:
#29395
Avatar

This server seems to keep the HTTP connection open after sending all the file data. A workaround is to change line 511 of sources/files.php from:

Code

         $line=fread($mysock,1024);
to:

Code

         $line=fread($mysock,1024);
         if ($line=='') break;
(i.e. add a new line)


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Support me on Patreon
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#29396
Avatar

This fix isn't ideal - it will cause problems with servers that spit out data slowly. A more complex fix is to change lines 508-511 from:

Code

      while (!@feof($mysock))
      {
         $line=fread($mysock,1024);
to:

Code

      $first_fail_time=NULL;
      while (!@feof($mysock))
      {
         $line=fread($mysock,1024);
         if ($line=='')
         {
            if (!is_null($first_fail_time))
            {
               if ($first_fail_time<time()-5) break;
            } else $first_fail_time=time();
         } else $first_fail_time=NULL;


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Support me on Patreon
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#29430
Avatar

Community saint

I changed it (the second advice) but the result is:

Error

    The requested item could not be loaded by the proxy.

    Document contains no data

Proxy server at ps3lux.cec.eu.int on port 8012

:(
Back to the top
 
Posted
Rating:
#29431
Avatar

I think this demonstrates something actually. My code says "wait for 5 seconds of empty reading before deciding that the server has finished sending data". It looks like if an ocPortal page load takes 5 seconds, this proxy error is generated. You might want to experiment with numbers lower than 5.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Support me on Patreon
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#29462
Avatar

Community saint

On the next day it was working with 5 seconds as well.

But now instead of news from Wikipedia I got this line: XML error when parsing RSS/Atom stream: xml declaration not at start of external entity at line 4

Code

[block title="WikiTravel" param="http://wikitravel.org/rss/english.rss"]main_rss[/block]
Back to the top
 
Posted
Rating:
#29466
Avatar

Ooh, I think that's an invalid feed.
Try changing line 84 of sources/rss.php from:

Code

         if (!xml_parse($xml_parser,str_replace('<?xml version="1.0" encoding="utf-8"?>',$extra_data,$data),true))
to:

Code

         if (!xml_parse($xml_parser,str_replace('<?xml version="1.0" encoding="utf-8"?>',$extra_data,trim($data)),true))


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Support me on Patreon
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#29550
Avatar

Community saint

but the line, you mentioned starts with "elseif", not with if. Does it change something?
Back to the top
 
Posted
Rating:
#29555
Avatar

The line numbers we state in patches may be off by a few lines, depending on various factors. The correct line should look as the line quoted, and be close to line 84.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Support me on Patreon
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: