Page 1 of 1

How to update feeds

Posted: 28 Dec 2010, 17:54
by 234my1
Hello,

I'm looking for a method to update my feeds in the background (on a regular basis). I read the article about UpdatingFeeds. Unfortunatley my webspace doesn't provide a cron service or console access.
However I could schedule a script (on a public cron service) to load a page on my webspace (e.g. update.php) on a regular basis.

Is there a possibility to pass a parameter (-feeds) to update.php, when making a HTTP call?
Does this even work?

Thanks for feedback or other creative ideas.

Re: How to update feeds

Posted: 29 Dec 2010, 03:23
by Joschasa
Without changing the code, it is not possible to use the update.php via http. It uses argv[] to determine the command line parameters, it wont work via http.
Perhaps it would work, if you just edit the first lines to accept $_GET[] or something like that. Or just set $op = "-feeds".

Re: How to update feeds

Posted: 31 Dec 2010, 15:28
by fox
You can call the update url as specified in the wiki (section about updating using wget), I guess it should work.

Re: How to update feeds

Posted: 12 Feb 2011, 22:52
by 234my1
Thanks for your feedback. If I call the backend.php (with the respective parameters) in my browser, the feeds are refreshed.
Works :).

I checked some free cron services: All of them are stating, that they will quit a job after 30 seconds.
They recommend to add the following lines to the PHP script, to continue the execution when the job stopped:

set_time_limit(0);
ignore_user_abort(true);


Will this also work for TT-RSS (if I add them to backend.php)?
If so, would it make sense to include this in one of the next releases?

Re: How to update feeds

Posted: 13 Feb 2011, 00:01
by fox
The update sequence usually takes more than 30 seconds. You might want to limit the amount of feeds that get updated in one run so you wouldn't run out of time.

In backend.php:440,

Code: Select all

         update_daemon_common($link, 0, true, true);


It's the second parameter. You can try setting it to 5 feeds or so if it doesn't work properly.

If so, would it make sense to include this in one of the next releases?


I'm not sure it's really necessary - default maximum runtime interval of a PHP script usually is 30 seconds, apache kills the process afterwards.