You are here:  » how many rss magic parser function a webpage can handle ?


how many rss magic parser function a webpage can handle ?

Submitted by fraizor on Mon, 2016-10-24 14:38 in

i have as single php page that have about 36 magicparser functions

when it was about 20 it was working grate
but now it seems to parse everything but not reaching the last line in the script !

here is my full code

{link saved}

Submitted by support on Mon, 2016-10-24 16:17

Hi,

There's no limit to the number of parses you can make, but it sounds like you may be reaching a PHP / web server imposed maximum execution time.

The first thing to try would be to add the following code to the top of your script:

  set_time_limit(0);

Hope this helps!
Cheers,
David
--
MagicParser.com

Submitted by fraizor on Tue, 2016-10-25 11:11

hi
thanks for fast replay
i tried your suggestion
but it did not worked, still having the same results ?

any other ideas ?

PS: i thought that when timeout occurs it will print that in the script right ?

Submitted by support on Tue, 2016-10-25 11:25

Hi,

Not necessarily as it depends on the PHP configuration. Try also adding at the top of your script:

  ini_set('display_errors','on');
  error_reporting(E_ALL);

...and that might indicate if timeout is the issue...

Cheers,
David
--
MagicParser.com

Submitted by fraizor on Tue, 2016-10-25 12:34

hi
i tried your suggestion

i got this:

Notice: Undefined index: LINK in /home/hlemxmti/public_html/API/engine.php on line 1225

that is wired because the error happened in a function that is very similar to other functions , plus that line in specific is exactly the same in all other functions.
i know that this problem is not related to your product, i appreciate your help a lot.
thanks in advanced

Submitted by support on Tue, 2016-10-25 12:59

Hi,

That's actually a notice rather than an error so probably doesn't affect operation of your code at all - to display errors only, you would use:

   error_reporting(E_ERROR);

Cheers,
David
--
MagicParser.com

Submitted by fraizor on Tue, 2016-10-25 13:55

Hi
still until now the code does not reach the end of the script
it must echo "end"
and print the execution time

i was printing those when i had about only 15 functions
now i have about 35 when this problem occurred

as i mentioned earlier
it seems to parse all the functions correctly (judging from the results)
should i worry about the last 2 lines not being excited ?

PS: if you need the code i could send it not problem

thanks

Submitted by support on Tue, 2016-10-25 14:18

Hi,

If it's just a case of not seeing the final output, there is the possibility that it is a rendering issue - in other words, the browser is not completing the output because it is expecting the HTML to be closed cleanly - and if this is not the case due to an issue with the output that may be what is causing you to miss the closure.

One test, would not be to output the description field of any of your feeds "as is", because basically, you have to trust that their HTML is complete / valid - if it is not, the invalidity of the RSS content results in your own page becoming invalid.

One way to check this, would be that wherever you are outputting content from your feeds that contains its own HTML markup, would be to output it using strip tags, for example, in place of:

  print $record["DESCRIPTION"];

...use:

  print strip_tags($record["DESCRIPTION"]);

That way, you can rule out broken HTML in your feeds being the reason for not seeing the closure of your own page content...

Hope this helps!
Cheers,
David
--
MagicParser.com

Submitted by fraizor on Thu, 2016-10-27 22:01

hi
it did not solved the problem
so i ended up to devide the script to smaller scripts
i thing the problem was that the script is taking too long

thanks anyway, for the great support and product

Submitted by support on Fri, 2016-10-28 08:26

Hi fraizor,

No problem - thanks for your comments!

One thing you might want to consider perhaps is not having your website script fetch the pages in real time, but instead having a CRON process that runs, say, every 30 minutes and fetches all the RSS feeds to a local directory.

Then, your website script just parses the local files for each page view (which is also better for the websites serving the RSS feeds has they don't get a hit every time there is a hit to one of your pages) and would be much faster!

Cheers,
David