PDA

View Full Version : rss bot


ROTPAR
04-03-2013, 07:39 PM
hi, i want the rss bot to check for new update all 24 or 48 hours. The problem is, in the settings dropdown i only can choos 12 hours as maximum. What could I do to change that to 28 hours?

2.) I noticed that there seems to be a problem, if I use 4 rss bot, posting from 4 different sources. Each of the bots is using a own nickname. If they all post, it doesnt work, nothing happens but if I deactiveate 3 of the bots, the one left, is working. Whats wrong there?

thank you for any help

kh99
04-04-2013, 12:09 AM
If you edit file admincp/rssposter.php, around line 363 is the end of the list of choices:
36000 => construct_phrase($vbphrase['x_hours'], 10),
43200 => construct_phrase($vbphrase['x_hours'], 12),
), $feed['ttl']);



If you want, you can add some lines to that, like:
36000 => construct_phrase($vbphrase['x_hours'], 10),
43200 => construct_phrase($vbphrase['x_hours'], 12),
86400 => construct_phrase($vbphrase['x_hours'], 24),
172800 => construct_phrase($vbphrase['x_hours'], 48),
), $feed['ttl']);



(The first number is the number of seconds in that many hours). I looked at the rss poster code and it looks like that's the only change you should have to make, but I haven't actually tried it.

As for your second issue, I think some feeds contain something that causes an error in the rss poster code and it crashes, so the other feeds don't get processed. I helped someone a few months ago with a similar problem, but I never heard back from him to know if it worked. Maybe later I'll have a chance to dig it up and see what the fix was.

ROTPAR
04-04-2013, 07:28 AM
Hey kh99 Great thank you so much. I will try that :) and if you find a Solution for the other, that would be awesome :) Thank you for your help

ROTPAR
04-06-2013, 11:30 AM
Ok it looks like this:

print_select_row($vbphrase['check_feed_every'], 'ttl', array(
600 => construct_phrase($vbphrase['x_minutes'], 10),
1200 => construct_phrase($vbphrase['x_minutes'], 20),
1800 => construct_phrase($vbphrase['x_minutes'], 30),
3600 => construct_phrase($vbphrase['x_minutes'], 60),
7200 => construct_phrase($vbphrase['x_hours'], 2),
14400 => construct_phrase($vbphrase['x_hours'], 4),
21600 => construct_phrase($vbphrase['x_hours'], 6),
28800 => construct_phrase($vbphrase['x_hours'], 8),
36000 => construct_phrase($vbphrase['x_hours'], 10),
43200 => construct_phrase($vbphrase['x_hours'], 12),
86400 => construct_phrase($vbphrase['x_hours'], 24),
172800 => construct_phrase($vbphrase['x_hours'], 48),
259200 => construct_phrase($vbphrase['x_hours'], 72),
345600 => construct_phrase($vbphrase['x_hours'], 96),
432000 => construct_phrase($vbphrase['x_hours'], 120),
518400 => construct_phrase($vbphrase['x_hours'], 144),
), $feed['ttl']);


The problem is, if I want to select 120 hours or what ever I added, it will reset to default 30 minutes after I saved. Any ideas? :)

Thank you

kh99
04-06-2013, 11:47 AM
Ok, you would also need to edit file includes/class_dm_rssfeed.php and find this around line 162, and add the lines in red:

switch ($ttl)
{
case 518400: // every 144 hours
case 345600: // every 96 hours
case 432000: // every 120 hours
case 259200: // every 72 hours
case 172800: // every 48 hours
case 86400: // every 24 hours
case 43200: // every 12 hours
case 36000: // every 10 hours



Apparently when the code was written, someone felt it was important to make sure that value could only be set to one of the "official" values. :)

I'll look for that other code to see if the fix helps you.

ROTPAR
04-06-2013, 11:57 AM
Didn't help, sorry :( that is really weird and I dont understand why vbulletin gives my only minutes values.

kh99
04-06-2013, 12:06 PM
Didn't help, sorry :( that is really weird and I dont understand why vbulletin gives my only minutes values.

Hmm..OK, there may be some other check somewhere. I'll have to look around more.

As for the other issue, What I told the guy is this: In file includes/cron/rssposter.php, around line 453, I made this change (add the curly brace in red, delete the one in blue on the last line):


}
if (!empty($feeds))
{
// update lastrun time for feeds
$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "rssfeed
SET lastrun = " . TIMENOW . "
WHERE rssfeedid IN(" . implode(', ', array_keys($feeds)) . ")
");
}

}


I don't remember the reasoning behind it, and I don't know exactly what your problem is, so I don't know if this will fix it. But I think it had something to do with the fact that if a feed has a problem, the original code will just keep trying that feed over and over. This change makes it update the feed check time so that it will cycle through the other feeds instead of getting stuck on one.

kh99
04-06-2013, 12:20 PM
Didn't help, sorry :( that is really weird and I dont understand why vbulletin gives my only minutes values.

OK, the (hopefully last) problem is that the field in the database where the time is saved is a "smallint" which only holds up to 65535. So if you really want to do this, you can modify the rssfeed table in the database and change the ttl field to be mediumint (or int if you think you'll ever want a value greater than 90 days or so).

Sferle
12-17-2015, 08:47 AM
Thanks for the advice , I would add MySQL code:

mysql> use "forumname"
mysql>ALTER TABLE rssfeed MODIFY ttl MEDIUMINT

forumname is your forum database !

I am now 24 and 48 hours at options.