PDA

View Full Version : Administrative and Maintenance Tools - Make RSS Feed Checking More Frequent


Dan Druff
06-27-2012, 10:00 PM
This modification adds options for checking RSS feeds more frequently than every 10 minutes.

You will now have the option to set RSS feeds to be checked every 2 minutes or 5 minutes, in addition to the existing options of 10 minutes and up.

This is mostly done through minor source code edits.

First, edit includes/class_dm_rssfeed.php

Search for:

case 600: // every 10 minutes


... and add IMMEDIATELY AFTER...

case 300: // every 5 minutes
case 120: // every 2 minutes



Next, edit admin/rssposter.php

Search for:

600 => construct_phrase($vbphrase['x_minutes'], 10),


... and add IMMEDIATELY BEFORE:

120 => construct_phrase($vbphrase['x_minutes'], 2),
300 => construct_phrase($vbphrase['x_minutes'], 5),


That's it! Now you will have the option in the RSS Feed Manager to add feeds to be checked every 2 or 5 minutes. You can also go back to your existing feeds and change them to be checked every 2 or 5 minutes.

One more thing... you will have to modify the RSS Poster Robot settings in the Scheduled Tasks, or the feeds still won't be checked more frequently than once every 10 minutes.

To do this, go to the Admin Control Panel, select Scheduled Task Manager, and then click Go under RSS Poster Robot.

Make sure Days of the Month, Days of the Week, and Hour are all set to *. Then go change the first column of Minute also to *. The result should look like the below attachment.

Lee Roberts
07-17-2012, 07:54 AM
Cheers Dan,

This should give me what i need to set for above 12 hours, any problems doing that that you know of ?

Regards,
.Me

CoZmicShReddeR
07-17-2012, 08:17 AM
Am waiting to see issues with it double posting same news...

Lee Roberts
07-17-2012, 08:50 AM
No problem i've just made the changes to mine for 24 and 48 hours will let you know what happens, i cant see there being a problem with double posting.


case 259200: // every 72 hours
case 172800: // every 48 hours
case 86400: // every 24 hours



86400 => construct_phrase($vbphrase['x_hours'], 24),
172800 => construct_phrase($vbphrase['x_hours'], 48),
259200 => construct_phrase($vbphrase['x_hours'], 72),



Unless you know somthing we dont Shredder ?

.Me

Lee Roberts
07-17-2012, 11:45 AM
Dan I’ve got a problem, when I save the feed after making a selection for the TTL its not saving. Going back to the feed to edit it the TTL setting is set to 10 minutes, selecting any of the vB stock times works and they get saved.

So it’s got me thinking something must be missing in the database, going to have a look now but can you look at yours and see if you get the same thing or dose yours remember your choice?

Thanks,

.Me

Lee Roberts
07-17-2012, 01:50 PM
Ok i think i have worked it out, it looks as though vB seems to only support 65535 so call it 18 hours, anything above that it just inserts "65535" into the ttl.

Dan Druff
07-21-2012, 08:24 AM
Interesting. I didn't know about the 65535 limitation.

Other than that, I don't see any problems with setting additional options for higher than the max time allowed by default, provided you edit the PHP files described above accordingly.

Lee Roberts
07-21-2012, 05:51 PM
Hi Dan,

There is no problem going higher in that sense, the 65535 is a 16bit limit i.e. (2^16=65536).

The problem is/was with the database, the TTL column type is set to "smallint(5)" by default, changing this to int(11) fix's the problem. I'm now running a feed and checking ever 48 hours with no problems so far.

Obviously anyone reading this should understand what they are doing and note it is not recommended that you edit core files in this way, you also shouldn’t really be messing with the database. Next time you update vB it’s possible that the files will have changed and any edits you made could be lost, it’s also not the intended use for the product.

I'm going to turn this into a proper modification/plug-in, I will need it myself Dan and no doubt you and others would find it beneficial.

.Me

fintan74
10-06-2012, 07:11 PM
Thanks for this! I had made the changes to rssposter.php already, but couldn't figure out which other file kept resetting my choices back to 30 minutes :) This saved me a lot of searching.

Lee Roberts
10-08-2012, 05:45 PM
No problem Fin glad it was of help to you, not had the time to make it a MOD yet but i will at some point.

Lee

voter
06-11-2013, 10:12 AM
Ok i think i have worked it out, it looks as though vB seems to only support 65535 so call it 18 hours, anything above that it just inserts "65535" into the ttl.
The table that need to be changed is rssfeed

voter
06-11-2013, 10:15 AM
By the way, if you want generally increase the frequency of reading feeds, it could be done much more simple without editing the php scripts or database.

Just change the frequency of RSS Poster Robot in Scheduled Task Manager.