Log in

View Full Version : NEW Modified RSS News Feed Hack


Pages : [1] 2 3

Slapyo
04-12-2004, 10:00 PM
Hack originally posted by: Xyphen (https://vborg.vbsupport.ru/member.php?u=26070) - RSS News Feed Hack (https://vborg.vbsupport.ru/showthread.php?t=60899)
Modified by: wolfstream (https://vborg.vbsupport.ru/member.php?u=27399) - Modified RSS News Feed Hack (https://vborg.vbsupport.ru/showpost.php?p=492109&postcount=139)

I am posting this up as a new hack because of the major changes made to how the script works. Also, I didn't want people to get confused as to which one to download since there were 3 different versions on the original post.

Xyphen released the original version, then wolfstream modified the script and corrected some errors. After that, I modified wolfstreams version to change how posts were inserted. Now the post count will increase, posts will be able to be searched, and similiar threads will work.

RSS News Feed Hack for vB 3.0.x. As long as vBulletin doesn't change the database structure much, this should be good for the next release also, and those to come.

Allows you to have a live RSS news feed (such as one from Google or CNET) in a forum. The user that posts it will basically be a bot, which *should* only be used for posting the news, but you can even make it for a regular user.

Comments are welcome! Support provided through this thread.

Latest Version:
- 1.26 - for PHP 4.3.0 & above
- 1.26a - for PHP prior to 4.3.0

vBulletin Versions:
- 3.0.0
- 3.0.1

PHP Versions:
- > 4.3.0
- < 4.3.0

Installation Overview:
- Files to edit: (2) /admincp/index.php, /includes/functions_newpost.php
- Files to upload: (4) rss.php, admincp/rss_admin.php, includes/RSS/class.RSS.php, includes/RSS/rss_update.php
- Queries to run: (4) in rss_install.php

History:
Version 1.26 (23 June 2004 - Slapyo, Natch)
- listing of bot's more intuitive (Natch)
- hopefully fixed duplicate problem (Slapyo)
- stripped html tags from title and description (Slapyo)

Version 1.25 (12 May 2004 - Slapyo)
- fix for &quot; showing up
- logs action in scheduled task log if turned on

Version 1.24 (20 April 2004 - Slapyo)
- posts now deleted with delete_thread function
- post counts updated when using delete all news

Version 1.23 (14 April 2004 - Slapyo)
- added ability to delete bots
- cleaned up includes
- fix for PHP versions prior to 4.3.0 calling html_entity_decode()

Version 1.22 (13 April 2004 - Slapyo)
- duplicate posts problem fixed
- fix for problem with ' appearing as \'

Version 1.21 (12 April 2004 - Slapyo)
- bot will not be subscribed to posts now

Version 1.2 (11 April 2004 - Slapyo)
- posts now inserted with build_new_post function

Version 1.1 (28 March 2004 - wolfstream)
- file edits taken down to 1
- cron script included

Version 1.0 (28 January 2004 - Xyphen)
- original release

Common RSS Feeds:
- Yahoo! (http://news.yahoo.com/rss/)
- CNET.com (http://www.cnet.com/4520-6022-5115113.html)
- BBC (http://www.bbc.co.uk)
- Wired News (http://www.wired.com/news/rss)
- The Register (http://www.theregister.co.uk/)
- Ars Technica (http://www.arstechnica.com/)
- All Headline News (http://www.allheadlinenews.com/addnews/xml.shtml)

mharmon
04-13-2004, 02:10 AM
I tried it this evening and had it working in 5 minutes.. AWESOME! :)

dethfire
04-13-2004, 03:57 AM
yep, this works! only problem is that it doesn't check if news item already exist, so for all my cron I had to set it to 24h to make sure the rss files were completely changes with new items, otherwise it's a charm!

achtungbaby
04-13-2004, 03:59 AM
I have a problem. First, I got this error after uploading the new files:

Database error in vBulletin 3.0.0:

Invalid SQL: CREATE TABLE `rss_settings` (`enabled` tinyint(1) NOT NULL default '1' ); mysql error: Table 'rss_settings' already exists

mysql error number: 1050

Date: Monday 12th of April 2004 09:46:35 PM
Script: http://forums.yellowworld.org/rss_install.php
Referer:
Username: achtungbaby

I assumed maybe it was cause I'd accidentally left the old RSS files. So then I run the upgrade and get this error:

Database error in vBulletin 3.0.0:

Invalid SQL: ALTER TABLE rss_settings DROP forumid, DROP userid, DROP source mysql error: Can't DROP 'forumid'. Check that column/key exists

mysql error number: 1091

Date: Monday 12th of April 2004 09:46:51 PM
Script: http://forums.yellowworld.org/rss_upgrade.php
Referer:
Username: achtungbaby

And now it appears that much of my forums has disappeared. What happened?

achtungbaby
04-13-2004, 04:17 AM
Nevermind. I think I figured it out. The script was conflicting with another hack I installed earlier -- the welcome PM hack.

Slave
04-13-2004, 04:27 AM
Whoo .. cool hack/add on :) ..

I've been having a play on my dev board .. a few things jump out at me ..

(I'm using a BBC rss news feed btw)

1/ I'm getting \ in front of ' .. any way to stop that?

2/ Any reason for the bot to subscribe to the thread? as it seems to do it .. if not needed how would you stop that?

3/ I've run the rss cron job 3 times in the last few mins to test it .. and it doesn't seem to know that it's already posted a story and therefore reposts it. Is the subscription to the thread meant to stop that? Is there any way to get the bot to know it has already posted about a subject?

I'll continue playing and post if anything else seems amiss ..

Good job though :)

Slapyo
04-13-2004, 04:55 AM
<a href="http://www.sportsbabble.net/showthread.php?t=570" target="_blank">http://www.sportsbabble.net/showthread.php?t=570</a>

there is a link to a post made by my news bot and it has ' in it ... but without the leading \, what is the link to the rss feed you are using?

i just uploaded a new version that fixes the bot subscribing to the threads. it should no longer subscribe to threads. the change was in rss_update.php so you can upload just that file if you want.

i can't see what is causing the problem with stories being posted multiple times. on mine i don't get the multiple stories, but every once in a while. the original author included a check in the program, but it is obviously not working properly. the code for this is in rss_update.php. i will look at it more.

Slave
04-13-2004, 05:34 AM
The news feed I'm using at the mo is ..

http://news.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss091.xml

Cheers for the subscribing fix .. :)

As for the double posting .. I guess it might be to do with the feed I'm using .. I'm sure you'll see it when you have a play if it is ..

Just added a screenshot of the \' problem .. it's happening in both titles and messages ..

rocket98
04-13-2004, 06:27 AM
Hi,

Very interesting hack. I have installed it but got this error when I ran it to see what it would pull down.

Fatal error: Call to undefined function: html_entity_decode() in /homepages/23/d95339147/htdocs/public_html/forum/includes/RSS/rss_update.php on line 70

Thanks

PranK
04-13-2004, 06:33 AM
The last one sent my server load through the roof - is this likely to happen with this one?

Thanks!

Christian

mirdin
04-13-2004, 07:02 AM
The last one sent my server load through the roof - is this likely to happen with this one?

Thanks!

Christian

Not likely. I believe the old hack would fetch the rss feed every time someone would enter the forum.

For this one you have to set a cronjob.

jluerken
04-13-2004, 07:10 AM
Hi,

Very interesting hack. I have installed it but got this error when I ran it to see what it would pull down.

Fatal error: Call to undefined function: html_entity_decode() in /homepages/23/d95339147/htdocs/public_html/forum/includes/RSS/rss_update.php on line 70


Thanks
I get the same error
Fatal error: Call to undefined function: html_entity_decode() in /home/www/web1/html/forum/includes/RSS/rss_update.php on line 70

mirdin
04-13-2004, 07:20 AM
I get the same error
Fatal error: Call to undefined function: html_entity_decode() in /home/www/web1/html/forum/includes/RSS/rss_update.php on line 70

This function is only present in PHP 4.3.0 and later, which version are you running?

http://www.php.net/manual/en/function.html-entity-decode.php

jluerken
04-13-2004, 08:07 AM
This function is only present in PHP 4.3.0 and later, which version are you running?

http://www.php.net/manual/en/function.html-entity-decode.php
I am running PHP Version 4.2.2

And what now?

mirdin
04-13-2004, 10:49 AM
I am running PHP Version 4.2.2

And what now?

You'll have to ask your host to upgrade to a more recent version of PHP.

Or if you follow the link to the php function I posted before, it shows this code:

// For users prior to PHP 4.3.0 you may do this:
function unhtmlentities($string)
{
$trans_tbl = get_html_translation_table(HTML_ENTITIES);
$trans_tbl = array_flip($trans_tbl);
return strtr($string, $trans_tbl);
}

$c = unhtmlentities($a);

echo $c; // I'll "walk" the <b>dog</b> now

?>

If upgrading PHP is not possible for you then you could try to replace the html_entity_decode function using this example.


By the way, has anyone managed to fix the double post issues? I have these issues with both yahoo and bbc feeds.

Acido
04-13-2004, 11:42 AM
http://www.sportsbabble.net/showthread.php?t=570

there is a link to a post made by my news bot and it has ' in it ... but without the leading \, what is the link to the rss feed you are using?

i just uploaded a new version that fixes the bot subscribing to the threads. it should no longer subscribe to threads. the change was in rss_update.php so you can upload just that file if you want.

i can't see what is causing the problem with stories being posted multiple times. on mine i don't get the multiple stories, but every once in a while. the original author included a check in the program, but it is obviously not working properly. the code for this is in rss_update.php. i will look at it more.
I'm getting multiple Stories too. The feed that i'm using is :
http://www.lanacion.com.ar/herramientas/rss/index.asp?origen=2
If help, the fields: rdd_feed and rss_date in the thread table, are always empty :ermm:

I'll apreciate if you can help me to avoid duplications, triplications, etc... using the bot. I think that the filter most be based in the title of the feed only, but i dont know how fix it.

Thanx in advance !

Slapyo
04-13-2004, 01:27 PM
ok, i think i have solved the problem with the duplicate posts. after acido mentioned that there were blank fields for the rss_feed and rss_date i realized that the vB function doesn't insert the new data.

so, to fix it i have uploaded v1.22 ... this includes the following changes:
- one more modification to functions_newpost.php (edit and upload)
- one fix to rss_update.php (just upload new one)

mharmon
04-13-2004, 01:33 PM
On the Yahoo feeds located at:

http://news.yahoo.com/rss

Is there anyway to specify a variable in the URL so you can limit the amount of headlines it grabs? I don't want 40-50 news items appearing in a forum -- I'd rather limit it to 5-10 a day..

Slapyo
04-13-2004, 01:40 PM
that would be up to the feed itself if they were to accept something like that. i mean i guess you could go into the code and change the loop so that it didn't loop from:

0 -> # news articles
to
0 -> 10 (or 5)

mharmon
04-13-2004, 01:42 PM
Slapyo -- Where would I change that? Can you find where that it is and shoot it over to me?

rocket98
04-13-2004, 02:03 PM
[QUOTE=mirdin]You'll have to ask your host to upgrade to a more recent version of PHP.

Or if you follow the link to the php function I posted before, it shows this code:

// For users prior to PHP 4.3.0 you may do this:
function unhtmlentities($string)
{
$trans_tbl = get_html_translation_table(HTML_ENTITIES);
$trans_tbl = array_flip($trans_tbl);
return strtr($string, $trans_tbl);
}

$c = unhtmlentities($a);

echo $c; // I'll "walk" the <b>dog</b> now

?>

If upgrading PHP is not possible for you then you could try to replace the html_entity_decode function using this example.


-----
I read the install instructions for this hack, it specified no where that certain version number dependencies were required before implementing ... it just said whoopee let's go!!!


It may not be possible for some of us to "TELL" our ISP to UPGRADE some ISP's don't give a rat's a$$ about what we do on their systems they just want their $4.95 a month.

Replace this CODE WHERE?

Thank you.

Acido
04-13-2004, 02:12 PM
ok, i think i have solved the problem with the duplicate posts. after acido mentioned that there were blank fields for the rss_feed and rss_date i realized that the vB function doesn't insert the new data.

so, to fix it i have uploaded v1.22 ... this includes the following changes:
- one more modification to functions_newpost.php (edit and upload)
- one fix to rss_update.php (just upload new one)I'm getting a Database conflict when i run the cron on the task manager:


Database error in vBulletin 3.0.0:

Invalid SQL:
INSERT INTO thread(title, lastpost, forumid, open, replycount, postusername,
postuserid, lastposter, dateline,
iconid, visible, attach, similar, rss_feed, rss_date)
VALUES
('Rod++++ bati? su propio r?cord de velocidad en el saque', 1081868007, 1060,
1, 0, 'Deportes', 4573,
'Deportes', 1081868007, 0, 1,
0, ', 1, ')

mysql error: Column count doesn't match value count at row 1

mysql error number: 1136
New threads are created, but i need rebuild forum information to see the last post in the forum display. Also, the field rss_date is still null .

Hope help.

SnowBot
04-13-2004, 02:37 PM
so, to fix it i have uploaded v1.22 ... this includes the following changes:
- one more modification to functions_newpost.php (edit and upload)
- one fix to rss_update.php (just upload new one)
The Zip still says 1.21. Are the new files within this zip?

Host Visions
04-13-2004, 03:48 PM
Thanks for this. Any idea how to not have duplicate posts?

mirdin
04-13-2004, 04:13 PM
so, to fix it i have uploaded v1.22 ... this includes the following changes:
- one more modification to functions_newpost.php (edit and upload)
- one fix to rss_update.php (just upload new one)

Downloaded 1.22, took the original functions_newpost.php and made the changes and uploaded it, also uploaded the new rss_update.php and still it is not recognizing already posted articles.

rss_feed fields values are all 0, rss_date fields are still empty.

SnowBot
04-13-2004, 05:03 PM
i have installed this but hhhmm nothing is being posted :( any ideas?

The forum is set corectly as i have just click the delete all news posts and wiped the forum completely :( But i guess that part works......

So the bot / user isnt posting

SnowBot
04-13-2004, 07:16 PM
OK i re traced my steps and now when i try and run the scedual task i get this

rss.php

ChannelData($leftOvers,$x); } return; } /* * void parse ( string data ) */ function parse($data="") { $channels = $this->parseChannels($data); if(empty($channels)) { return; } $this->parseItems($channels); return; } /* * Finito */ } ?>d); } } } } // // ------------------------------ // End of RSS News Hack ?>

Help :)

Slapyo
04-13-2004, 07:51 PM
sorry guys, i tried to get the new one up before i left for class for the day and found an error so i pulled it quickly and put back 1.21. i will fix the problem and get it back up when i get home from classes for the day.

also, i will make note of the problem with php version and include a fix for those that maybe have a lower version and can't change it.

i wasn't aware of that problem, and since it was working on mine i figured it was good to go. will include that in the next fix.

i'm still at school right now between classes, won't be home till later tonight though. hopefully i will have it checking for duplicate posts and i will have the fix for lower php versions in the install.

Slapyo
04-13-2004, 09:00 PM
ok, i have fixed the duplicate post problem. it now inserts the data into the rss_feed and rss_date fields. it should check the post and not post it if it is a duplicate.

also, i have included in the rss_update.php file a section of commented code. if you use a version of PHP prior to 4.3.0 you will need to uncomment this section out, and then comment the 2 lines above it.

Slave
04-13-2004, 09:08 PM
Thanks Slapuo .. :)

Any news about the \ problem?

(not tried 1.22 yet so don't know if still doing it :) .. yep it is)

Slapyo
04-13-2004, 09:19 PM
i didn't do anything with the \' problem. i don't know what is causing that. i looked at your feed and it looks just like the one i use from yahoo. however, i do not have that problem in my code.

i looked and this seems to be the culprit


$rss_title = mysql_escape_string($rss_title);
$rss_description = mysql_escape_string($rss_description);


because in the function to insert the post it uses addslashes() ... so i think it is putting \\' instead of \' like it should. then it removes the \ and leaves the trailing \' ... i have just uploaded a new 1.22 try that one. if you don't want to download it. all i did was remove those 2 lines of code from the rss_update.php file.

SnowBot
04-13-2004, 09:22 PM
hhhmm

All i get when running the task is this

rss.php

ChannelData($leftOvers,$x); } return; } /* * void parse ( string data ) */ function parse($data="") { $channels = $this->parseChannels($data); if(empty($channels)) { return; } $this->parseItems($channels); return; } /* * Finito */ } ?>nito */ } ?>d); } } } } // // ------------------------------ // End of RSS News Hack ?> $post['signature'] = true; $post['emailupdate'] = 9999; $post['title'] = $rss_title; $post['message'] = $rss_description; $post['poststarttime'] = TIMENOW; $post['rss_date'] = $rss_dateline; $post['posthash'] = md5($post['poststarttime'] . $bbuserinfo['userid'] . $bbuserinfo['salt']); // build the thread build_new_post('thread', $foruminfo, array(), 0, $post, $errors, $rss_userid); } } } } // // ------------------------------ // End of RSS News Hack ?>

now :(

any help, whats going on?

Slave
04-13-2004, 09:23 PM
ok tar ..

I just had a play in the "Replacement Variable Manager" and added a new one to replace \' with ' and it seems to work :) .. but I'll also try your way too ..

:)

Slave
04-13-2004, 09:27 PM
i didn't do anything with the \' problem. i don't know what is causing that. i looked at your feed and it looks just like the one i use from yahoo. however, i do not have that problem in my code.

i looked and this seems to be the culprit


$rss_title = mysql_escape_string($rss_title);
$rss_description = mysql_escape_string($rss_description);


because in the function to insert the post it uses addslashes() ... so i think it is putting \\' instead of \' like it should. then it removes the \ and leaves the trailing \' ... i have just uploaded a new 1.22 try that one. if you don't want to download it. all i did was remove those 2 lines of code from the rss_update.php file.
Just tried your latest change .. and it works :)

Also the duplicate problem has gone too it seems ..

Cheers ,., :D

Slapyo
04-13-2004, 09:29 PM
@SnowBot ... are you in the scheduled tasks telling the script to run right now? or are you just letting it run on it's own? or are you just loading the rss.php file? i will look and see what i can find, but that code is from the original author and i haven't made any changes to it at all. i will see if i can find something. have you tried downloading the new version 1.22 and uploading that, overwriting all previous rss files?

@Slave ... i just uploaded a new fix for your problem. since i am not having the same problem on my machine i don't know if it works or not. could you try it out. you will have to remove your replacement variable for \' to see if it works. i think it will though, i think it was doubling up the \'s so it had \\' instead of \' like it should have.

Slave
04-13-2004, 09:31 PM
Yeah .. tried it .. and it works .. :)

Slapyo
04-13-2004, 09:32 PM
Just tried your latest change .. and it works :)

Also the duplicate problem has gone too it seems ..

Cheers ,., :D
ok good to know! thanks!

SnowBot
04-13-2004, 09:35 PM
Yes this is from the task manager, when i hit the Run Task now button to see if its all working i get this.

I overwritten all the 1.21 files with the new 1.22 ones. NO post nothing :(

Slave
04-13-2004, 09:36 PM
heh .. just installing it to my live forums now .. :)

Slapyo
04-13-2004, 09:44 PM
Yes this is from the task manager, when i hit the Run Task now button to see if its all working i get this.

I overwritten all the 1.21 files with the new 1.22 ones. NO post nothing :(
i assume you have made a bot and given it the proper user id, forum id, and rss fed url?

what is the feed you are trying to use?

SnowBot
04-13-2004, 09:52 PM
Yes done that

rss feed = http://news.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss091.xml .xml (http://news.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss091.xml)

Slave
04-13-2004, 09:55 PM
* Slave clicks install ..

Works brill .. :) .. One user (News Bot) in 3 forums ..

SnowBot
04-13-2004, 09:57 PM
i assume you have made a bot and given it the proper user id?I set up a new usergroup just for bots and added a new user to that group. In the RSS News feed menu i added a bot with the forum id as 29

http://www.synergyforums.com/forum/forumdisplay.php?f=29

Added the user id as

276 and that feed

Slapyo
04-13-2004, 10:05 PM
I set up a new usergroup just for bots and added a new user to that group. In the RSS News feed menu i added a bot with the forum id as 29

http://www.synergyforums.com/forum/forumdisplay.php?f=29

Added the user id as

276 and that feed
ok

forum id: 29
user id: 276
source: http://news.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss091.xml

and you ran the rss_install.php file too correct?

everything sounds like you have it set up correctly. what version of PHP do you have?

SnowBot
04-13-2004, 10:09 PM
Yep i ran the script, if i try running it again i get this

Database error in vBulletin 3.0.0:
Invalid SQL: CREATE TABLE `rss_settings` (`enabled` tinyint(1) NOT NULL default '1' );
mysql error: Table 'rss_settings' already exists
mysql error number: 1050
Date: Tuesday 13th of April 2004 07:07:38 PM
Script: http://www.synergyforums.com/forum/rss_install.php
Referer:
Username: Snowy
IP Address: **.**.**.**


PHP version 4.3.5

Slapyo
04-13-2004, 10:11 PM
is your scheduled task is set up like this?

filename: ./rss.php

the other fields depend upon you, whatever you want to call it and whenever you want the script to run. but the file name should look like that.

SnowBot
04-13-2004, 10:19 PM
Yep

Slapyo
04-13-2004, 10:28 PM
wow, that's weird. it looks like it is just printing out part of the code from class.RSS.php and from rss_update.php ... but i don't know why it is doing this. lemme look some more.

SnowBot
04-13-2004, 10:32 PM
Just a note, if i try and run the upgrade script i get this error

Database error in vBulletin 3.0.0:
Invalid SQL: ALTER TABLE rss_settings DROP forumid, DROP userid, DROP source
mysql error: Can't DROP 'forumid'. Check that column/key exists
mysql error number: 1091
Date: Tuesday 13th of April 2004 07:30:18 PM
Script: http://www.synergyforums.com/forum/rss_upgrade.php
Referer:
Username: Snowy

How would i unistall the script and then try running it again ? Maybe that may fix it ? ? I dunno, i guess im just guessing here now :(

Slapyo
04-13-2004, 11:40 PM
delete these tables:
vb3_rss_settings
vb3_rss_user

modify the vb3_thread table, delete these 2 fields:
rss_feed
rss_date

** Note: the table prefix might be different for you, but my table prefix is vb3_

remove these files:
rss.php
rss_install.php
rss_upgrade.php
/admincp/rss_admin.php
/includes/RSS/class.RSS.php
/includes/RSS/rss_update.php

then download the newest version, 1.22, and install it. hopefully this works.

ConqSoft
04-13-2004, 11:56 PM
Well, I just installed for the first time, using the latest 1.22 ZIP and I have a couple of issues.

1) I'm getting duplicates. :( Any ideas? (Using the Yahoo! News Oddly Enough feed only, for now.)

2) If a " is in the title, it shows up as &quot;

Slapyo
04-14-2004, 12:01 AM
you shouldn't get duplicates. the newest version checks for duplicates. check your vb3_thread table and see if the bot posts have entries in the rss_feed and rss_date fields. i am using a yahoo news feed myself and don't get the duplicates. another person using the BBC news feeds was getting duplicates, but then says that problem is gone with the new version.

the function in the rss hack checks to see if the title & pubDate are the same. if both are the same, it is considered old.


$rss_title = html_entity_decode($rss_title, ENT_NOQUOTES);
$rss_description = html_entity_decode($rss_description, ENT_NOQUOTES);


that SHOULD take care of converting the &quot; to ". that is the purpose of the function according to PHP. however, if that doesn't work then you can insert this code just below the code i posted above.


$rss_title = str_replace("&quot;", "\"", $rss_title);
$rss_description = str_replace("&quot;", "\"", $rss_description);

ConqSoft
04-14-2004, 12:12 AM
Ok, that fixed the quote problem. Thanks!

I'll let it run for a while again now and see if the dupes show up.

Thanks again.

ConqSoft
04-14-2004, 12:20 AM
Ok. I verified that the rss_date field is being updated.

So, I went to the RSS manager and deleted all news.

Then I manually ran the cron job using the Run Now button in my scheduled task manager.

And it pulls in several copies of each message for some reason. The duplicates aren't right next to each other in the list. It's just like it pulled the RSS feed twice for some reason, and didn't catch the dupes. I dunno...

I tried it a couple of times with the same results...

SnowBot
04-14-2004, 12:21 AM
OK i did all that, i run the task again and this time i DIDNT get that error but no post :( hehe it just dont like me i guess :(

ConqSoft
04-14-2004, 12:27 AM
Nevermind. :( I think it's just the feed itself repeating articles.

Thanks!

SnowBot
04-14-2004, 12:40 AM
:( Well the user i set up still has NOT appeared on whois online or posted :(

No db errors

Nothing, i have rechecked my install / file edits and everything is correct as far as i can see, just nothing is happening.

Any ideas?

Want me to set up an admin login so you can check ?

dethfire
04-14-2004, 01:17 AM
I have my cron set to every 20 hours, however once that 20 hours comes around the script seems to run 3 times creating 3 sets of duplicated

rocket98
04-14-2004, 01:42 AM
ok, i have fixed the duplicate post problem. it now inserts the data into the rss_feed and rss_date fields. it should check the post and not post it if it is a duplicate.

also, i have included in the rss_update.php file a section of commented code. if you use a version of PHP prior to 4.3.0 you will need to uncomment this section out, and then comment the 2 lines above it.

I will try this, thank you Slapyo !!!!

rocket98

----------------------------------------

I am at a complete loss ... I was playing and playing and then I uploaded the attached file and for some reason I got a BBC feed immediately after doing a manual run, no dups nothing just a BBC feed with 30 threads.

I think this was from the original hack. I found it on hotscripts today when i was looking around at all things RSS.

I honestly don't know what is different from your edits to the original hack. No PHP problems to speak of. Not sure if this works for others but i tried it and it seems to go ...

Here is my forum

SnowBot
04-14-2004, 01:56 AM
over an hour later and still nothing..... im at a loss now

Slapyo
04-14-2004, 04:41 AM
:( Well the user i set up still has NOT appeared on whois online or posted :(

No db errors

Nothing, i have rechecked my install / file edits and everything is correct as far as i can see, just nothing is happening.

Any ideas?

Want me to set up an admin login so you can check ?
snowbot, the bot will not appear in the who's online. the bot never actually logs into the system, it just uses the user info to make the post. if you want i can take a look at it for you, no promises that i will find the error.

but you uninstalled it, then reinstalled the latest version correct? just want to make sure of that before i looked at anything. go ahead and PM me the information. then i will get back to you if i find anything. thanks.

Slapyo
04-14-2004, 04:45 AM
I will try this, thank you Slapyo !!!!

rocket98

----------------------------------------

I am at a complete loss ... I was playing and playing and then I uploaded the attached file and for some reason I got a BBC feed immediately after doing a manual run, no dups nothing just a BBC feed with 30 threads.

I think this was from the original hack. I found it on hotscripts today when i was looking around at all things RSS.

I honestly don't know what is different from your edits to the original hack. No PHP problems to speak of. Not sure if this works for others but i tried it and it seems to go ...

Here is my forum

http://bocastown.com/forum/forumdisplay.php?f=51
rocket98, that appears to be the original script. the problem i found with the original script is that when submitting the post, it is done manually. that way you will not be able to search the threads, similar threads won't work, and post counts will not increase properly.

what are the errors you are getting. if you want, PM me your email address and i will send you the rss_update.php file that you need. i read back and see that you need the one that is compatible with a version of PHP prior to 4.3.0 ... lemme know, i will send it to you.

Slapyo
04-14-2004, 04:46 AM
I have my cron set to every 20 hours, however once that 20 hours comes around the script seems to run 3 times creating 3 sets of duplicated
what is your feed that you are using? i haven't seen this error before, but that doesn't mean it isn't happening. it should load the rss file once then parse it, that's it.

rocket98
04-14-2004, 05:15 AM
rocket98, that appears to be the original script. the problem i found with the original script is that when submitting the post, it is done manually. that way you will not be able to search the threads, similar threads won't work, and post counts will not increase properly.

what are the errors you are getting. if you want, PM me your email address and i will send you the rss_update.php file that you need. i read back and see that you need the one that is compatible with a version of PHP prior to 4.3.0 ... lemme know, i will send it to you.

I'm hosted for Free on 1and1. On this particular server they are running php 4.2.3. After a couple of enquiries to support there I'm sad to say "non paying" customers have to put up with what they get for the free accounts.

I still had errors with redeclaring of htmlentities as shown here after following the instructions you provided in the update.

Fatal error: Cannot redeclare unhtmlentities() (previously declared in /homepages/23/d95339147/htdocs/public_html/forum/includes/RSS/rss_update.php:76) in /homepages/23/d95339147/htdocs/public_html/forum/includes/RSS/rss_update.php on line 76

I would like to have this work and do appreciate your efforts.

Thank you
rocket98

Michael Morris
04-14-2004, 08:39 AM
I tried to run this and got this error message...

Warning: file(http://www.wizards.com/rss.asp?x=dnd): failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error in /http/forums/includes/RSS/rss_update.php on line 32

Warning: implode(): Bad arguments. in /http/forums/includes/RSS/rss_update.php on line 32

All Done

mirdin
04-14-2004, 09:02 AM
$rss_title = str_replace("&quot;", "\"", $rss_title);
$rss_description = str_replace("&quot;", "\"", $rss_description);


Also had the same issue with &quot; showing up, now I've added these lines, hope that works :)

Apart from that everything seems to work nicely so far.
Great job!

Slapyo
04-14-2004, 01:44 PM
I tried to run this and got this error message...

Warning: file(http://www.wizards.com/rss.asp?x=dnd): failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error in /http/forums/includes/RSS/rss_update.php on line 32

Warning: implode(): Bad arguments. in /http/forums/includes/RSS/rss_update.php on line 32

All Done
that rss feed appears to not work for me. when i follow that link i just get a blank page. that might be the cause of your problem. in fact, i went through all of their RSS feed links and none of them would load up for me. the reason it is not working, is more that likely something on their end. none of their rss feeds will load up.

VodkaFish
04-14-2004, 02:31 PM
Is this hack for a single rss feed?

Slapyo
04-14-2004, 02:48 PM
you can set up as many bots/rss feeds as you want.

you could use the same bot over and have it post a different feed in a different forum. or whatever you want.

Morrus
04-14-2004, 05:13 PM
you can set up as many bots/rss feeds as you want.

you could use the same bot over and have it post a different feed in a different forum. or whatever you want.
This hack seems to be working fine!

Is there a way to change the formating of the output, though? Rather than a line break and then "View the entire article", can it be set to just append "(Read more...)" at the end of the text (no line breaks)?

ConqSoft
04-14-2004, 05:16 PM
Suggestion for a future version: Ability to give a descriptive name to the feed. If you use the same userid to post multiple feeds, they all show up the same in the dropdown. :(

Also, ability to delete a feed would be nice. :)

Good work!

gmarik
04-14-2004, 05:24 PM
This seems even better...

Slapyo
04-14-2004, 06:22 PM
This hack seems to be working fine!

Is there a way to change the formating of the output, though? Rather than a line break and then "View the entire article", can it be set to just append "(Read more...)" at the end of the text (no line breaks)?
if you want to change the output of the feed, just open up rss_update.php

FIND:

$rss_description = $rss_allItems[$j][DESCRIPTION];
$rss_description .= "{br}{br}View the Entire Article ( . $rss_allItems[$j][LINK] . ){br}";


REPLACE WITH:

$rss_description = $rss_allItems[$j][DESCRIPTION];
$rss_description .= " (Read more...) ( . $rss_allItems[$j][LINK] . ){br}";


you can format it however you like. but this is the section where you would modify the formatting of the post itself. note, you use the {br} tag to create breaklines, not the standard <br /> tag.

Slapyo
04-14-2004, 06:23 PM
Suggestion for a future version: Ability to give a descriptive name to the feed. If you use the same userid to post multiple feeds, they all show up the same in the dropdown. :(

Also, ability to delete a feed would be nice. :)

Good work!
ya, i noticed this problem too ... but now that i pretty much have the insertion of the post going good i can work on additional features for it.

sjau
04-14-2004, 08:04 PM
Hmmmm, good work to have opened a new thread with a fixed version :)

ckaosII
04-14-2004, 08:38 PM
Ehhh,

Sorry for not being an expert her..

I'm new to this stuff :rolleyes:

I've followed your install instruction, and now what? How do I get to work? Can I use other rss feeds?

I've noticed a Hacks section in my admincp containing: RSS News Feed but don't know how to configure it, would have been nice with a COMPLETE install/configure instruction for dummies like me :nervous:

ckaosII
04-14-2004, 09:18 PM
Hello,


Woahh, got it to work all by my self :rolleyes:

SnowBot
04-14-2004, 11:01 PM
Well i just cant understand this at all, i have it working fine on one of my boards, mostly un-hacked as its a new project.

www.thepremierleague.co.uk (http://www.thepremierleague.co.uk)

But its still not working on

www.synergyforums.com (http://www.synergyforums.com) I have done the exact thing but still doesnt work. I get no errors but nothing is being posted, all i can think of is that its another hack thats messing this up. synergyforums is hacked and modded a great deal.

I will PM you an admin login like was said and see if you can figure something out. Maybe you can tell what hack maybe stopping this from posting the feed.

Slapyo
04-15-2004, 03:06 AM
i have added in the ability to delete bots. until i can add in the ability to give a bot a description, i include the bot id next to the bot's name. hopefully this will help clear up some confusion as to the bots.

the only file edited was /admincp/rss_admin.php if you want to just upload that file.

Dontom
04-15-2004, 04:07 AM
i have added in the ability to delete bots. until i can add in the ability to give a bot a description, i include the bot id next to the bot's name. hopefully this will help clear up some confusion as to the bots.

the only file edited was /admincp/rss_admin.php if you want to just upload that file.
perfect - thank you!
I have a problem with one feed - it just wont work (other feeds worked for me)
Can someone tell me whats wrong with this one?
http://www.procycling.de/news/news_rss.php

Thank you
Tom

Slapyo
04-15-2004, 04:31 AM
what are the other feeds you are using? the only thing i can think of is in the feed that isn't working, the date field is called dc:date ... but in the script it is looking for pubDate.

what are the errors, or are there no errors showing up at all?

Dontom
04-15-2004, 05:18 AM
no errors at all - just a blank page if i call rss.php

Slapyo
04-15-2004, 05:46 AM
i think the problem is in the name of the date field. what is the url of the other news feeds you us?

SnowBot
04-15-2004, 05:47 AM
All works fine on vb 3.0.1 if anyone wonders.

jluerken
04-15-2004, 06:18 AM
All works fine on vb 3.0.1 if anyone wonders.
I am using php 4.2.2 and changes the lines in /includes/RSS/rss_update.php like described but starting the task will result in the following error:

Fatal error: Cannot redeclare fix_unhtmlentities() (previously declared in /home/www/web1/html/forum/includes/RSS/rss_update.php:76) in /home/www/web1/html/forum/includes/RSS/rss_update.php on line 76

ckaosII
04-15-2004, 07:06 AM
Donton wrote:
I have a problem with one feed - it just wont work (other feeds worked for me)
Can someone tell me whats wrong with this one?
http://www.procycling.de/news/news_rss.php

I have also problems with all news feeds containing:

<?xml version="1.0" encoding="ISO-8859-1" ?>
- <rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:hr="http://www.w3.org/2000/08/w3c-synd/#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/">

I only got feeds containing:

<rss version="x.x">

to work 100%



Looks like it's only able to read: "RSS feeds" and NOT "RDF feeds" ?!

Is it possible to add support for RDF feeds to?

Slapyo
04-15-2004, 01:14 PM
maybe later on ckaos ... i'll look into it.

i am still having a problem with the users who have a version of PHP prior to 4.3.0 ... the odd thing is the error that they get. it tells you that you can't redeclare the function, yet this is the only place the function is setup/called. you can changed the name to anything you want and it still gives this error. so i am not sure as to how i am redeclaring something even though it is the only time i have declared it. still working on it.

rocket98
04-15-2004, 07:07 PM
maybe later on ckaos ... i'll look into it.

i am still having a problem with the users who have a version of PHP prior to 4.3.0 ... the odd thing is the error that they get. it tells you that you can't redeclare the function, yet this is the only place the function is setup/called. you can changed the name to anything you want and it still gives this error. so i am not sure as to how i am redeclaring something even though it is the only time i have declared it. still working on it.
--------------------------

Slapyo, u fixed it for me. Moving the function outside the other else/if statements stopped the loop declaration. I still have the 4 bots running every 4 hours, but will set them to run every hour and see what happens. So far so good.

Thank you for your work on this one.

rocket98

Slapyo
04-15-2004, 07:17 PM
ok, i am pretty sure i have the fix for users with a PHP version prior to 4.3.0. the only differences between the 2 sets of files i have uploaded are some comments.

- rss_bot_#.##.zip - download this if you have PHP 4.3.0 & above
- rss_bot_#.##a.zip - download this if you have PHP prior to 4.3.0

Acido
04-15-2004, 08:17 PM
ok, i am pretty sure i have the fix for users with a PHP version prior to 4.3.0. the only differences between the 2 sets of files i have uploaded are some comments.

- rss_bot_#.##.zip - download this if you have PHP 4.3.0 & above
- rss_bot_#.##a.zip - download this if you have PHP prior to 4.3.0
BIG THANX Slapyo !

Now i have not more problems with Quotes \" and not more duplications.

I'm using rss_bot1.23a with PHP 4.3.4

;)

Slapyo
04-15-2004, 08:49 PM
actually rss_bot_1.23a is for people with a PHP version prior to 4.3.0 and you have PHP above 4.3.0 ... you should use rss_bot_1.23 .... but either way, it is working. they should work, it's just that the in rss_bot_1.23 i use a function that was not introduced till 4.3.0 and so i had to insert a workaround.

rss_bot_1.23 - normal
rss_bot_1.23a - workaround for PHP prior to 4.3.0

the workaround obviously works for either PHP above and below 4.3.0.

Aleksey
04-16-2004, 12:30 AM
I don't get it... what do I put for "Source"?

Slapyo
04-16-2004, 12:39 AM
you find a rss news feed. in my first post announcing this hack i listed a few different rss news feeds.

https://vborg.vbsupport.ru/showthread.php?t=63798

i'm using the yahoo sports news feed for my site. but you can use whatever feed(s) you would like to on your site. you can have more than one.

Aleksey
04-16-2004, 12:49 AM
I mean like do I put in "Yahoo!" or I put in url?

Slapyo
04-16-2004, 12:54 AM
oh, you would put in the URL to the RSS feed.

Aleksey
04-16-2004, 12:56 AM
Would that be http://rss.news.yahoo.com/rss/music or http://rss.news.yahoo.com/rss

Slapyo
04-16-2004, 12:58 AM
the music one. it has the data that you want. you can tell when you open the link to the rss feed up in the browser.

Aleksey
04-16-2004, 01:00 AM
Alright and it runs every hour, is there anyway I can manualy run it so I can see if it works or not?

EDIT: Sorry for all these question, I'm kind of retarded.

Slapyo
04-16-2004, 01:03 AM
yes, once you have set up your cron job in the scheduled tasks manager. you can open up the scheduled tasks manager and tell the cron job to run now. there is a button to the far right on every line for every cron job.

Aleksey
04-16-2004, 01:20 AM
thanks a lot

Aleksey
04-16-2004, 01:32 AM
Another thing, is there anyway to make it post whole article? Like look http://www.digitalwebforums.com/forumdisplay.php?f=19 it posts just stupid 2 lines of news and then says "View whole article here" I want it to post whole articles without those links, is that possible?

Slapyo
04-16-2004, 01:38 AM
nope. the news feed would have to have the entire article in it. that leaves it up to the website producing the news feed. some news feeds have longer descriptions than others. but most don't include the whole article.

Aleksey
04-16-2004, 01:39 AM
Ehh then this is useless...

dethfire
04-16-2004, 02:40 AM
I still get duplicates from yahoo rss, using 1.23

Slapyo
04-16-2004, 03:05 AM
hm, i'm not getting duplicates and i am using yahoo. which feed are you using from yahoo?

dethfire
04-16-2004, 03:06 AM
world news and politics

Slapyo
04-16-2004, 03:11 AM
can you look in your database in the vb3_thread table and see if it is filling the rss_feed and rss_date fields?

it should be filling them and then it checks the date in the rss_date field against the dates in the feeds.

dethfire
04-16-2004, 03:26 AM
yeah it fills just fine, it's not like it duplicates right away, it seems to run but run a few times

Slapyo
04-16-2004, 03:38 AM
could it be the news articles are closely related? maybe try getting a copy of the rss feeds when it runs, then get more copies later on and compare them. that's what i would try to do.

the script checks the article title and the pubdate of the article. if both are the same, it is marked as old and not posted.

PranK
04-16-2004, 03:43 AM
Not likely. I believe the old hack would fetch the rss feed every time someone would enter the forum.

For this one you have to set a cronjob.


fantastic! thanks!

will_lean
04-16-2004, 05:35 AM
HELP i installed this hack and it doesnt seem to post to the forum?
ived tried yahoo,slashdot and a few others and none of them seem to be working.
If i call rss.php i get a blank page,in adminCP i try to "run cron job"n as a test and it shows me a page with "rss" on it?
any ides what would be causing this to not display anything?

Slapyo
04-16-2004, 05:41 AM
did you run the install file?
what version of php do you have?
whats the url of the rss feeds you are trying to use?
do you have the bots set up properly with the right user id and forum id?
is the cron job set up correctly in the scheduled tasks manager?

will_lean
04-16-2004, 05:44 AM
yes i ran install fine,im using php 4.3.3
im using the yahoo and slashdot feeds from your intro post as well as a few other music site feeds.
I set the forum id to my news forum and have also tried the music forum but both dont show any news and rss.php is blank?

heres a feed i tried to use
http://rapdirt.com/newsrss10.php

i also have cron job set to 1 hour and have tested it but it shows a blank page with the letters rss at the top

Slapyo
04-16-2004, 05:59 AM
that feed won't work because it is a rdf feed....for now this only works with rss feeds. however the yahoo feeds and slashdot feeds are rss and will work.

could you post the info in your scheduled task, and possibly a screen shot of the page with rss at the top.

when you make the script run from the scheduled task manager, all you should see is the name you gave the task.

will_lean
04-16-2004, 06:05 AM
hmmm it seems as though it was the feed i was using they were RDF,ive tried another feed and it seems to work :)
but the posts seem to be formatted as so: <![CDATA[<p>Late last year, the RIAA confiscated up to 1,000 mixed CD's from Alan Berry's Indianapolis stores -forcing him to close the famed Hip-Hop franchise a few months later. Now, Berry is taking his RIAA fight to the hip-hop streets and calling artists like <b>50 Cent</b>, <b>Jay-Z</b> and <b>Eminem</b> to his defense.</p>]]>

any idea how i can get rid of the tags or is it the feeds im using?

Slapyo
04-16-2004, 06:19 AM
that is happening because of the feed you are using. some have the CDATA tags in front and behind. i'm not sure if this will work. it should. it is just replacing the things you don't want with what they should be, or in some cases nothing.

in rss_update.php FIND:
// Setup the thread

ABOVE ADD:

$rss_title = str_replace("<![CDATA[[", "", $rss_title);
$rss_description = str_replace("<![CDATA[[", "", $rss_description);
$rss_title = str_replace("]]", "", $rss_title);
$rss_description = str_replace("]]", "", $rss_description);
$rss_title = str_replace("<p>", "", $rss_title);
$rss_description = str_replace("<p>", "", $rss_description);
$rss_title = str_replace("</p>", "", $rss_title);
$rss_description = str_replace("</p>", "", $rss_description);
$rss_title = str_replace("<b>", "", $rss_title);
$rss_description = str_replace("<b>", "", $rss_description);
$rss_title = str_replace("</b>", "", $rss_title);
$rss_description = str_replace("</b>", "", $rss_description);

Mobile
04-16-2004, 07:59 AM
is there anyway to remove these posts from the search option because i've got a massive rss feed with about 400 posts and it gets too much looking through all the posts.

Mobile

Slapyo
04-16-2004, 01:00 PM
actually the 2nd news feed by wolfstream did this. try this: https://vborg.vbsupport.ru/showpost.php?p=492109&postcount=139

they were manually inserted into the database so post count doens't go up for those threads, similiar threads won't work for the posts, and you won't be able to search them at all. however, i don't offer any support for that version.

SnowBot
04-16-2004, 03:02 PM
Any news on fixing my problem yet ?

AWS
04-16-2004, 03:10 PM
The problem with dupe posts seems to be a problem with vbulletin cron. If I run the script manually it does not post duplicates. If it runs via cron.php it runs more than once and posts duplicates. The script will run until it times out when it reaches the php timeout or until the next scheduled task is to run.
Whne I figure out a fix I'll post it.

Slapyo
04-16-2004, 03:19 PM
Any news on fixing my problem yet ?
im still looking to see what i can find. so far i have no clue and the only thing i can say is that it and another mod you have are interferring.

Slapyo
04-16-2004, 03:32 PM
The problem with dupe posts seems to be a problem with vbulletin cron. If I run the script manually it does not post duplicates. If it runs via cron.php it runs more than once and posts duplicates. The script will run until it times out when it reaches the php timeout or until the next scheduled task is to run.
Whne I figure out a fix I'll post it.
actually it only runs one time. some people posting problems with duplicates actually have different news feeds. the script looks for the field pubDate ... some have something different for the date field like cc:date, some don't have a date field at all. also, one bug that i am pretty sure is in there that i will try and fix for the next update deals with duplicates.

if there is a " in the title, it will still post that even if it was posted before. this is because when it checks the database this is what happens:

title: this is my "news" feed
database: this is my \"news\" feed

both technically are the same, except for the escaped quotes. i think this is cause some posts with quotes in the title to be duplicated. i'm going to look into it further. i'm also trying to update the way posts are deleted with the delete all news function.

AWS
04-16-2004, 06:28 PM
Beleive me it does run more than once from cron. I added some code to log when it runs and it shows it ran 4 times back to back on the scheduled time. I get 4 entries everytime it runs. For some reason it runs until the next scheduled task runs and doesn't stop after the first run.

dethfire
04-16-2004, 06:29 PM
Beleive me it does run more than once from cron. I added some code to log when it runs and it shows it ran 4 times back to back on the scheduled time. I get 4 entries everytime it runs. For some reason it runs until the next scheduled task runs and doesn't stop after the first run.

I agree, I think this is my problem too, however why is it running 4 times, why are the other crons ok?

bradsears
04-16-2004, 06:32 PM
Slapyo - thanks very much for your continued work on this hack. You are saving us all a great deal of time.

Slapyo
04-16-2004, 06:34 PM
that's odd because mine is only running 1 time. if you come up with a fix for it let me know and i will include it in the package.

could you send me the code you used to log it so i can use it in mine and see if it helps with debugging. don_lacuran@hotmail.com is my email.

there is no loop in the program to grab the rss file more than once. unless of course you have more than one rss bot. i don't have this problem on mine, but it seems to be an issue with others. hopefully we can get it worked out.

mirdin
04-19-2004, 09:16 AM
actually it only runs one time. some people posting problems with duplicates actually have different news feeds. the script looks for the field pubDate ... some have something different for the date field like cc:date, some don't have a date field at all. also, one bug that i am pretty sure is in there that i will try and fix for the next update deals with duplicates.

if there is a " in the title, it will still post that even if it was posted before. this is because when it checks the database this is what happens:

title: this is my "news" feed
database: this is my \"news\" feed

both technically are the same, except for the escaped quotes. i think this is cause some posts with quotes in the title to be duplicated. i'm going to look into it further. i'm also trying to update the way posts are deleted with the delete all news function.


Article titles like the following are not recognized as duplicates.

**** Clark Has Diabetes, Says PR Firm (AP)
$1.2M for WTC Workers (AP)

In the database the $ sign is converted to $ ;
I don't understand why the first one is not recognized as a duplicate.

Mellow
04-20-2004, 12:19 PM
that would be up to the feed itself if they were to accept something like that. i mean i guess you could go into the code and change the loop so that it didn't loop from:

0 -> # news articles
to
0 -> 10 (or 5)


I'd like to know this too as I only want a few news posts per day.
Joe


Would changing this:
for($j = count($rss_allItems) - 1; $j >= 0; $j--) {

to this work:
for($j = 10 - 1; $j >= 0; $j--) {

???????

Joe

Slapyo
04-20-2004, 01:12 PM
I'd like to know this too as I only want a few news posts per day.
Joe


Would changing this:
for($j = count($rss_allItems) - 1; $j >= 0; $j--) {

to this work:
for($j = 10 - 1; $j >= 0; $j--) {

???????

Joe
ya, that looks like the code you would edit. then you only make your script run once every 24 hours in the cron job. and for the code you posted, you would get 10 news articles a day.

Mellow
04-20-2004, 01:14 PM
ya, that looks like the code you would edit. then you only make your script run once every 24 hours in the cron job. and for the code you posted, you would get 10 news articles a day.
Great, thanks for the quick reply

will_lean
04-20-2004, 03:56 PM
hello ive just done the code edit above to try and limit the number of posts the rss bot posts but it doesnt seem to be working,i only need 10 news items posted but its posting over 100 :surprised:
any idea why the above wouldnt work?
ive set my cron to 24hr update

Slapyo
04-20-2004, 09:15 PM
in rss_update.php FIND:

// insert the new items into the database
for($j = count($rss_allItems) - 1; $j >= 0; $j--) {


REPLACE WITH:

// insert the new items into the database
for($j = 10 - 1; $j >= 0; $j--) {


you are replacing "count($rss_allItems)" with the number of news articles you want. in the example code above i replaced it with 10. so it will take the 10 news articles and post them. however, i don't know if this will be a problem or not because if there are only like 5 news articles and you have hard coded in 10 news articles it might pose a problem.

will_lean
04-20-2004, 09:28 PM
thanks

ive set it so i can moderate the posts from the yahoo feed so i can pick 10 feeds and prune the rest.

WICKED hack!
thanks

Slapyo
04-21-2004, 06:56 AM
newest version: 1.24 (PHP > 4.3.0) and 1.24a (PHP < 4.3.0)

i rewrote the way Delete All News was done. it now uses a function within vB to delete the posts rather than a manual deletion of them. helps keep everything neat. it will also recount the posts in the forum.

yeloc
04-22-2004, 02:46 AM
Is there a way not to add the news posts to the total posts number?

Slapyo
04-22-2004, 05:26 AM
the original one did not increase the post count. but search and similiar threads didn't work either. i don't offer support for either of those. there has been numerous fixes and upgrades to the way things work. i would suggest that you use the modified original version if you are going to use one of them. it is more stable than the original.

https://vborg.vbsupport.ru/showthread.php?t=60899 - original
https://vborg.vbsupport.ru/showpost.php?p=492109&postcount=139 - modified original

yeloc
04-23-2004, 10:39 AM
what would I be doing wrong? The task is not updating on its own. It works fine when I hit the "run now" button. I have it set to run every hour.

Slapyo
04-23-2004, 03:30 PM
do you have a busy forum? i found the way that the cron jobs work in vB is that say you have a list of cron jobs 10 long. the page has to be loaded at or after the scheduled time for the cron job. my forum isn't too busy now and i found to get it to run i have to just reload the page a few times and the news will be inserted. mine is set to run at the hour every hour. if it hasn't run, i look in the scheduled tasks to see how many jobs before it haven't run yet. then i refresh the forums that many times.

yeloc
04-24-2004, 11:27 AM
Actually no this is a test forum that I setup.

Slapyo
04-24-2004, 02:07 PM
then that might be the problem. it's not actually a true cron job which will run on the hour every hour. you have to have the pages being loaded to check for the next cron job time. if it is time, or past time, it will run...next page load checks for the next cron job.

maresi
04-25-2004, 10:52 AM
first: great hack :up:
second: I tried to run the cronjob and got this error message...

Warning: main() [function.main (http://www.php.net/function.main)]: open_basedir restriction in effect. File(../class.RSS.php) is not within the allowed path(s): (/www/*****/*****/) in /www/*****/*****/includes/RSS/rss_update.php on line 28

Warning: main(class.RSS.php) [function.main (http://www.php.net/function.main)]: failed to create stream: Operation not permitted in /www/*****/*****/includes/RSS/rss_update.php on line 28

Fatal error: main() [function.main (http://www.php.net/function.main)]: Failed opening required 'class.RSS.php' (include_path='.:..') in /www/*****/*****/includes/RSS/rss_update.php on line 28

thx for help

maresi

ryanozawa
04-25-2004, 05:29 PM
I'm thrilled to have found this hack! I grabbed the latest live linked version as of yesterday (I'm running PHP 4.3.5), and followed the installation instructions. I did create a bot user, and a special forum for it to play in. I can get to the RSS administration panel, added a bot... but then nothing.

Question: When you run the ./rss.php task from the Scheduled Task manager, is there any confirmation message at all? Whenever I click it, it just says Update RSS... and nothing else. No error, but no "Done" either. It doesn't show up in the scheduled task log, either, which makes me doubt it's running.

Thanks for any help you can provide!

Slapyo
04-26-2004, 02:05 PM
first: great hack :up:
second: I tried to run the cronjob and got this error message...

Warning: main() [function.main (http://www.php.net/function.main)]: open_basedir restriction in effect. File(../class.RSS.php) is not within the allowed path(s): (/www/*****/*****/) in /www/*****/*****/includes/RSS/rss_update.php on line 28

Warning: main(class.RSS.php) [function.main (http://www.php.net/function.main)]: failed to create stream: Operation not permitted in /www/*****/*****/includes/RSS/rss_update.php on line 28

Fatal error: main() [function.main (http://www.php.net/function.main)]: Failed opening required 'class.RSS.php' (include_path='.:..') in /www/*****/*****/includes/RSS/rss_update.php on line 28

thx for help

maresi
sounds like you have a problem with open_basedir. are the files in the right folders? might want to check your php.ini file or do a phpinfo() and see if open_basedir has any restrictions in place.

Slapyo
04-26-2004, 02:07 PM
I'm thrilled to have found this hack! I grabbed the latest live linked version as of yesterday (I'm running PHP 4.3.5), and followed the installation instructions. I did create a bot user, and a special forum for it to play in. I can get to the RSS administration panel, added a bot... but then nothing.

Question: When you run the ./rss.php task from the Scheduled Task manager, is there any confirmation message at all? Whenever I click it, it just says Update RSS... and nothing else. No error, but no "Done" either. It doesn't show up in the scheduled task log, either, which makes me doubt it's running.

Thanks for any help you can provide!
nothing is posted to the log, even if it is turned on ... i plan on adding this feature in. if you see update rss then it ran without any major errors heh, thats the best i can tell you. i haven't even touched that part of the script yet.

what is the rss news feed you are trying to use, can u post the link to it.

ryanozawa
04-26-2004, 03:09 PM
Thanks for the quick reply! Here's my intended feed:

http://www.topix.net/rss/state/hi/

Ryan

ethics
04-26-2004, 03:17 PM
Can anyone put together a list of the RSS feeds that DO work with this? Slashdot, for example, doesn't.

Slapyo
04-26-2004, 03:54 PM
Thanks for the quick reply! Here's my intended feed:

http://www.topix.net/rss/state/hi/

Ryan
that is an RDF feed. won't work, only RSS feeds.

Slapyo
04-26-2004, 03:55 PM
Can anyone put together a list of the RSS feeds that DO work with this? Slashdot, for example, doesn't.
my inital post has a list of them. if any don't work let me know so i can remove.

Common RSS Feeds:
- Yahoo! (http://news.yahoo.com/rss/)
- CNET.com (http://www.cnet.com/4520-6022-5115113.html)
- BBC (http://www.bbc.co.uk)
- Wired News (http://www.wired.com/news/rss)
- The Register (http://www.theregister.co.uk/)
- Ars Technica (http://www.arstechnica.com/)

Briboy923
04-26-2004, 06:03 PM
When I add a new bot, do I just say "Yahoo!" for source, do i put in yahoo.com/rss ??? or what

ryanozawa
04-26-2004, 06:38 PM
that is an RDF feed. won't work, only RSS feeds.That would explain it! Fortunately, I found the feeds put out by AllHeadlineNews.com do work, and with regional news feeds, that's all I need. Now to read up on how to tweak the bot's posts... here (https://vborg.vbsupport.ru/showpost.php?p=500649&postcount=73).

For those interested (and if you'll pardon the self-link), here's my newsbot's playground (http://www.hawaiithreads.com/forumdisplay.php?f=63). I too tweaked the post format (rather than "View the entire article," I just made the headline a link). I sure wish my RSS source would pass a little more meat in the item description, though!

Finally, this autoprune hack (https://vborg.vbsupport.ru/showthread.php?p=491455) makes a great partner with the RSS News Feed hack. If your bot is posting dozens of threads a day, this can make sure you don't suddenly find yourself with 5,000 threads in your bot's forum.

Slapyo
04-26-2004, 06:51 PM
When I add a new bot, do I just say "Yahoo!" for source, do i put in yahoo.com/rss ??? or what
for the source you will put in the URL to the RSS news feed.

the_sisko
04-27-2004, 06:33 PM
First of all, nice work. I read through the original hack thread and this one and came up with a question.

I'm runnig a german board and tried some rss feeds. most of them don't have a pubDate field. What happens when they don't have this field? Does it work anyway or do I have to create a workaround for it?

Any other german here with good working news feeds?

P.Jackson
04-27-2004, 07:59 PM
Now this is tru be lucky to get 3 words :(

.

For those interested (and if you'll pardon the self-link), here's my newsbot's playground (http://www.hawaiithreads.com/forumdisplay.php?f=63). I too tweaked the post format (rather than "View the entire article," I just made the headline a link). I sure wish my RSS source would pass a little more meat in the item description, though!

Slapyo
04-27-2004, 10:01 PM
First of all, nice work. I read through the original hack thread and this one and came up with a question.

I'm runnig a german board and tried some rss feeds. most of them don't have a pubDate field. What happens when they don't have this field? Does it work anyway or do I have to create a workaround for it?

Any other german here with good working news feeds?
it should work, it just won't submit anything to the rss_date field in the database. then this means that when it is checking for duplicates it won't find any "old" articles and it will post duplicates if there are any.

Slapyo
04-27-2004, 10:03 PM
Now this is tru be lucky to get 3 words :(
ya .... that's the problem of most RSS news feeds, but the purpose of them is not to give the full article, but just to give a tiny description of what the article is about. they want you to goto their site to read the whole article. although some places put the whole news in the RSS feed. just gotta find those places or deal with the tiny TINY descriptions. i wish they would give a little bit longer description, not just a sentance, maybe more like a paragraph.

MaxScript
04-28-2004, 11:58 PM
ok , i have installed it and i still have no feeds ?

Natch
04-29-2004, 03:35 AM
My request with this would be a mod to have each NewsFeed in one thread, not a new thread for each feed ...

Any ideas Slapyo ?

Slapyo
04-29-2004, 12:59 PM
ok , i have installed it and i still have no feeds ?
do you get any kind of error messages at all? is everything correct?

you set up a bot?
you set up scheduled task?
you installed everything properly?

what is the link to the rss feed you are using.

Slapyo
04-29-2004, 01:01 PM
My request with this would be a mod to have each NewsFeed in one thread, not a new thread for each feed ...

Any ideas Slapyo ?
could be done ... would have to look into it. would probably just be a shift in the code and change a couple things. the title would be something like "news posted at {insert time}" then inside would have the news description and link for every news article. lemme look into it some.

MaxScript
04-29-2004, 09:53 PM
do you get any kind of error messages at all? is everything correct?

you set up a bot?
you set up scheduled task?
you installed everything properly?

what is the link to the rss feed you are using.

yup yup

un-install it went back to the first one .... but that one only on forum feeds out of 4

www.batalk.com

Slapyo
04-29-2004, 10:43 PM
hm, my script is derived from the original script. it should work if you followed the install instructions.

i take it you are using a Yahoo!News feed. those work fine for me, i am using the sports feed for my site.

make sure you follow the instructions step by step in the setup. i know you probably did. but not knowing what is going on, that is all i can tell you right now.

MaxScript
04-29-2004, 11:04 PM
if you like to go in as admin , Pm me

krohnathlonman
05-02-2004, 12:27 AM
I'm having a bunch of dumplicate post problems....

Slapyo
05-03-2004, 01:08 AM
does your news feed have a pubDate field. if it doesn't have a date field, or if it is named something other than pubDate you will get duplicate posts.

Leah
05-03-2004, 06:08 AM
Is it possible to get this to work with rdf also?

Milez
05-03-2004, 12:39 PM
just gotta find those places or deal with the tiny TINY descriptions.

Anyone have any idea where these feeds might be? 3 words does not a useful thread make.

Good script btw been following it since it was first hashed out.

krohnathlonman
05-03-2004, 02:17 PM
The duplicate posts are the lack of pubdate.....

Also how do I make &quot; display as " instead?

Slapyo
05-03-2004, 03:48 PM
Is it possible to get this to work with rdf also?
will have to see if i can find an RSS/RDF class that can be incorporated into this.

Slapyo
05-03-2004, 03:50 PM
in rss_update.php FIND:

// Setup the thread


ABOVE ADD:

$rss_title = str_replace("&quot;", "\"", $rss_title);
$rss_description = str_replace("&quot;", "\"", $rss_description);

Slapyo
05-03-2004, 03:53 PM
Anyone have any idea where these feeds might be? 3 words does not a useful thread make.

Good script btw been following it since it was first hashed out.
http://www.syndic8.com

search there for RSS feeds. you might find some that are longer than a sentance description.

bradsears
05-03-2004, 04:10 PM
I'd love to get google news alert emails to work with this system. They generally have a slightly longer description and you can create them for any group of key words.

danbc
05-04-2004, 09:05 AM
How/what/where do one use to get personalised information posted automaticly?

We have 3 news sources we want to use..

1 anticheat news
2 jokes & fun
3 tournement news

These items we want to post both on our own site in 3 different forums, but also make the RSS available to affiliate sites, who will then use a PHPNuke version of this script to have the same contens posted.

But I can?t find any way of doing this without being a scriptgeek :( I?ve tried Nucleus, which has a admin login page, which fits our needs, since other site admins should be allowed to post news aswell..

But I can?t seem to get this to work :(

Any input/ideas?

The hack is working like a charm btw, so it?s gonna end up on our final site..:!

Slapyo
05-04-2004, 12:10 PM
hm, if i understand you correctly. you can set up 3 different news bots to run. then vbulletin comes with an external data provider.

admincp -> vBulletin Options -> External Data Provider

you can chose javascript, RSS, XML.

danbc
05-04-2004, 06:30 PM
Yep, but the problem is making a news source that the bots can connect to, and preffereble a solution that has an ability to have different users adding the source.

Ted S
05-05-2004, 03:58 AM
Great hack, I had it up and running in minutes (yes minutes). I have only one question and that would be how/where do I modify class.RSS.php to filter for a word. That is to say I intend to pull down the entire rss feed from the bbc and cnn but I only want to use resutls that contain the word(s) "scuba" "diver" or "diving" in either their description or title. Clearly having this as a per-bot feature would be great but if you can tell me how to hard code it I'd be ever thankful.

vau7
05-06-2004, 02:30 AM
I moved to a new Server and now i get these errors if i run the cron:

Warning: main() [function.main]: open_basedir restriction in effect. File(../class.RSS.php) is not within the allowed path(s): (/www/htdocs/v109581/) in /www/htdocs/v109581/includes/RSS/rss_update.php on line 28

Warning: main(class.RSS.php) [function.main]: failed to create stream: Operation not permitted in /www/htdocs/v109581/includes/RSS/rss_update.php on line 28

Fatal error: main() [function.main]: Failed opening required 'class.RSS.php' (include_path='.:..') in /www/htdocs/v109581/includes/RSS/rss_update.php on line 28

Any Idea? I've installed & checked it now 3 Times, everything seems to be correct...


Thanks ins Advance

Leah
05-06-2004, 04:23 PM
will have to see if i can find an RSS/RDF class that can be incorporated into this.
That would be great.
What are the requirement for the rss/rdf class?

I'm an amateur when it comes to this, but is this what you're looking for?
http://www.fase4.com/en/rdf/sub,doc,index.html

Slapyo
05-06-2004, 05:46 PM
I moved to a new Server and now i get these errors if i run the cron:

Warning: main() [function.main]: open_basedir restriction in effect. File(../class.RSS.php) is not within the allowed path(s): (/www/htdocs/v109581/) in /www/htdocs/v109581/includes/RSS/rss_update.php on line 28

Warning: main(class.RSS.php) [function.main]: failed to create stream: Operation not permitted in /www/htdocs/v109581/includes/RSS/rss_update.php on line 28

Fatal error: main() [function.main]: Failed opening required 'class.RSS.php' (include_path='.:..') in /www/htdocs/v109581/includes/RSS/rss_update.php on line 28

Any Idea? I've installed & checked it now 3 Times, everything seems to be correct...


Thanks ins Advance
might be a problem with the INI file and permissions set. if you can't change your INI file, you should contact your hosting provider. that's all i can think of.

Slapyo
05-06-2004, 05:48 PM
That would be great.
What are the requirement for the rss/rdf class?

I'm an amateur when it comes to this, but is this what you're looking for?
http://www.fase4.com/en/rdf/sub,doc,index.html
looks like it could work. when i have some time i will go through this some more. in midterms right now with lots of tests and papers due. *faints*

LLFan
05-06-2004, 05:52 PM
Fantastic addition to the vB hack community--thank you.

I have this issue when trying to run the scheduled task manually (since I have had no posts):

Warning: main(.rss.php): failed to open stream: No such file or directory in /home/mysite.com/forums/admin/cronadmin.php on line 56

Fatal error: main(): Failed opening required '.rss.php' (include_path='.:/usr/local/lib/php') in /home/mysite.com/forums/admin/cronadmin.php on line 56

Any ideas?

Slapyo
05-07-2004, 12:31 AM
yup, your path is wrong in your scheduled task. go make sure it says this:


./rss.php

LLFan
05-07-2004, 03:45 AM
Thanks. =)

For some reason the All Headlines News is only formatting news in this format: politicalwire.com - May 7 2004 5:25:0 GMT

Is that correct?

Ted S
05-07-2004, 05:20 AM
Anyone know how I could add a field to each bot to make a fitler for required words so that instead of a bot pulling down every feed it pulls down only certain, matching feeds?

LLFan
05-07-2004, 05:21 PM
A couple things,

* do I need to enable html in the forum the bot posts in? If not why is this: &quot; showing?
* Can people reply to the threads or does it have to be a bot only forum?

I ask because when I tried to have a thread of my own creation the BBC Bot threw up a ton of news under my username! The id is correct, and not mine.

Any ideas?

LLFan
05-08-2004, 04:11 AM
>>I ask because when I tried to have a thread of my own creation the BBC Bot threw up a ton of news under my username! The id is correct, and not mine.<<

Did it again but different newsbot and in a completely closed forum for everyone but the bots. Note, it's also using people who have no permissions to post in there.

Any ideas?

Slapyo
05-10-2004, 08:56 PM
>>I ask because when I tried to have a thread of my own creation the BBC Bot threw up a ton of news under my username! The id is correct, and not mine.<<

Did it again but different newsbot and in a completely closed forum for everyone but the bots. Note, it's also using people who have no permissions to post in there.

Any ideas?
the feed you are using may not have the pubDate field in it, this could be causing the problems with the date.

are you using the latest version of the news bot? this was a problem with a previous version that has now been fixed. you have to edit a couple of files as well as upload the included files.

can people reply to the posts? yes, if your forum is set up with it's permissions to allow it.

this should fix the &quot; problem:

in rss_update.php FIND:

// Setup the thread


ABOVE ADD:

$rss_title = str_replace("&quot;", "\"", $rss_title);
$rss_description = str_replace("&quot;", "\"", $rss_description);

Slapyo
05-10-2004, 08:57 PM
Anyone know how I could add a field to each bot to make a fitler for required words so that instead of a bot pulling down every feed it pulls down only certain, matching feeds?
that would require some changes to the script as well as some changes to the mysql tables. you would need to make a table that had the words you want to use as a filter. then you would have to modify the code in the script to make it check for those words.

Leah
05-11-2004, 06:34 PM
looks like it could work. when i have some time i will go through this some more. in midterms right now with lots of tests and papers due. *faints*
Hehe..
I know the feeling. I shouldn't even be here now. :o

LLFan
05-12-2004, 05:01 PM
Using 1.2.4 which is the latest release to the best of my knowledge.

>>can people reply to the posts? yes, if your forum is set up with it's permissions to allow it.<<

I wanted to know if it is a known issue to allow members to post in the forum the bot posts in because of the issue I was having with the bot using the wrong userID.

Slapyo
05-12-2004, 06:21 PM
oh no, that shouldn't be a problem allowing users to start posts as well as the bot to make posts.

the way i have mine set up is that only the bot is allowed to start posts, but people can reply to them. however for some time i did have it so that anyone could start a post. as long as you have the bot installed properly with the correct file edits, everything should work perfectly. your bot will make the posts and they won't show up from some other user.

Aceman
05-12-2004, 08:40 PM
I have a display problem when it comes to showing TITLES of threads created from the RSS from scifi.com

http://www.scifi.com/scifiwire/rss/index.xml

The threads titles appear like this:

&apos;Potter&apos; Designer Talks Challenges

THE ORGINAL TEXT IS: 'Potter' Designer Talks Challenges

Now I fixed my display problems in the thread with replacement for "&apos;" to " ' " and those are showing fine.. however the thread titles are not.. What can I do to fix this?

Aceman

Link to my news forum: http://www.scifi-meshes.com/forums/forumdisplay.php?f=90

Aceman
05-12-2004, 08:46 PM
I'm a duffis.. I fixed it buy using the code you placed eariler:

$rss_title = str_replace("&apos;", "'", $rss_title);
$rss_description = str_replace("&apos;", "'", $rss_description);

Aceman
05-12-2004, 11:37 PM
I'm getting duplicated threads when the rss runs on the hour. I checked the (scifi.com) rss link and it DOES have a pubdate.

<pubDate>Wed, 12 May 2004 12:26:39 EST</pubDate>

Yet I still have duplicates?? Any suggestions.

Slapyo
05-12-2004, 11:41 PM
newest version: 1.25 (PHP > 4.3.0) and 1.25a (PHP < 4.3.0)

this update fixes the problems with &quot; and it also will insert into the scheduled task log if you have it turned on ... atleast it should. heh, of course any problems let me know.

files changed are: rss.php and rss_update.php ... so if you want to make the changes yourself, or just upload those 2 files ... that's fine.

in rss.php FIND:

?>


ABOVE ADD:

log_cron_action('RSS News Feed Posted', $nextitem);


in rss_update.php FIND:

// Setup the thread


ABOVE ADD:

$rss_title = str_replace("&quot;", "\"", $rss_title);
$rss_description = str_replace("&quot;", "\"", $rss_description);
$rss_title = str_replace("&apos;", "'", $rss_title);
$rss_description = str_replace("&apos;", "'", $rss_description);

Slapyo
05-12-2004, 11:50 PM
I'm getting duplicated threads when the rss runs on the hour. I checked the (scifi.com) rss link and it DOES have a pubdate.

<pubDate>Wed, 12 May 2004 12:26:39 EST</pubDate>

Yet I still have duplicates?? Any suggestions.
i think the problem lies within the &quot; and &apos; problem. if there is a " or ' in the title it is changed and then in the database it is checked.

" != &quot;
' != &apos;

so it thinks it's a new title and it then posts. could you please check in phpMyAdmin and see if it is storing the data for the title with the &quot; or &apos; .... unfortunately i have not seen this in my news articles yet so i can't verify this.

Aceman
05-13-2004, 12:51 AM
I'm not sure if this was the fix YET.. but I did notice something about code..


// filter out the old items
while($rss_thread_data = $DB_site->fetch_array($rss_query)) {
for($j = count($rss_allItems) - 1; $j >= 0; $j--) {
if($rss_thread_data[title] == $rss_allItems[$j][TITLE] &&
$rss_thread_data[rss_date] == $rss_allItems[$j]['pubDate']) {
$rss_allItems[$j][OLD] = true;
}
}
}


Around pubDate there was NO ' ' so I put them in.. seems to be working.. but I'm still testing.. I'll post soon.. if you already know (cause your a php pro) that this isn't the solution.. please tell me.. cause I'm definately NOT a php pro..

Aceman

***UPDATE*** This did NOT fix my duplication problem. I'm getting ALOT of duplicated threads.. help me!

Aceman
05-13-2004, 04:46 PM
... could you please check in phpMyAdmin and see if it is storing the data for the title with the &quot; or &apos; .... unfortunately i have not seen this in my news articles yet so i can't verify this.

I just checked my phpMyAdmin and this is how threads that are replicated are having their TITLES stored in the database.

New &quot;Mobile Console&quot; Plays PC Games

Does this help? is their a fix?

Certain threads ARE still duplicating.. and I reuploaded your files to my server again to make sure it wasn't something I'd screwed up. I'm using 1.25 as my version of PHP is higher then 4.3.0.

Aceman

Slapyo
05-13-2004, 05:45 PM
ya ok, then it is what i think it is and this should be fixed by my update i am hoping. i made it fix the titles with " and ' in them instead of having &quot; or &apos; they will have " and ' .... here is the problem:

New &quot;Mobile Console&quot; Plays PC Games

does not equal

New "Mobile Console" Plays PC Games

when compared to each other the " and ' are not converted to &quot; or &apos; ... or vice versa. the literal strings do not match each other even though to me and you they are the same. let it run for a little bit on the new 1.25 and let me know if this fixes the problem with the multiple posts.

P.Jackson
05-15-2004, 10:34 PM
any ideas why the thread and post count isnt updating in subforums?

Slapyo
05-17-2004, 02:35 AM
it should. the newest version takes care of that. make sure you have the latest version. it updates on mine and i am running the same version i have uploaded here, no changes.

P.Jackson
05-17-2004, 07:09 PM
any ideas why the bots post as different users now since upgrade? was working ok before..

Slapyo
05-17-2004, 11:33 PM
there were no changes in the code that has to do with making the post. all of that stayed the same, just quotes were changed and then it was recorded in the scheduled tasks log if you have it turned on. mine is still posting with the bot and nobody else and i use v1.25 off this upload.

P.Jackson
05-18-2004, 03:53 PM
tried that and still messed up is posting from the user that views the thread yet its meant to post the news every hour only

peterjun
05-19-2004, 01:28 AM
Can anyone help me trouble shoot this error message? I've installed per directons and when i run rss.php manually, I get this:

Warning: main(class.RSS.php): failed to open stream: No such file or directory in /home/peterjun/public_html/includes/RSS/rss_update.php on line 28

Fatal error: main(): Failed opening required 'class.RSS.php' (include_path='') in /home/peterjun/public_html/includes/RSS/rss_update.php on line 28

Interestingly, I also don't have the configuration panel (admincp -> hacks -> rss news feed) in my admincp and had to manually point my webpage to that php file. Thanks for any help!

Slapyo
05-19-2004, 02:57 AM
did you make the file edits? there are 2 files that you have to edit. read the instructions.txt and you will see the files you need to edit and what changes need to be made.

P.Jackson
05-19-2004, 03:54 PM
fixed my prob slapya i hope :D

Slapyo
05-19-2004, 09:13 PM
everything running like it should now?

peterjun
05-20-2004, 02:36 AM
Thanks Slapyo. I solved the problem with the admincp by editing the file.. I edited the other files, but still get the same error message.

Warning: main(class.RSS.php): failed to open stream: No such file or directory in /home/peterjun/public_html/includes/RSS/rss_update.php on line 28

Fatal error: main(): Failed opening required 'class.RSS.php' (include_path='') in /home/peterjun/public_html/includes/RSS/rss_update.php on line 28

I'll delve more, but was wondering if you knew any quick solutions.

Erwin
05-20-2004, 12:25 PM
Good job. :) I'm running this as a cron job on my server - I just removed the log cron action function from the rss.php file. It works well. Thanks!

proxyMX
05-20-2004, 02:19 PM
You'll have to ask your host to upgrade to a more recent version of PHP.

Or if you follow the link to the php function I posted before, it shows this code:

// For users prior to PHP 4.3.0 you may do this:
function unhtmlentities($string)
{
$trans_tbl = get_html_translation_table(HTML_ENTITIES);
$trans_tbl = array_flip($trans_tbl);
return strtr($string, $trans_tbl);
}

$c = unhtmlentities($a);

echo $c; // I'll "walk" the <b>dog</b> now

?>

If upgrading PHP is not possible for you then you could try to replace the html_entity_decode function using this example.


By the way, has anyone managed to fix the double post issues? I have these issues with both yahoo and bbc feeds.
Sorry, call me stupid, but how do you actually get an RSS feed?

Slapyo
05-20-2004, 07:39 PM
my initial post for this hack has a list of some common RSS feeds, it is at the very bottom of the post just above the attachments.

Erwin
05-21-2004, 11:57 AM
Is there any way to avoid the bot posting the same headlines again and again?

Slapyo
05-21-2004, 02:07 PM
is there a pubDate field in the feed you are pulling?

Intex
05-22-2004, 09:20 AM
Slapyo - very nice hack. I've installed it and it works fine.

The only problem I can see is when the RSS feeds are pulled in, e.g. from The Register, the oldest posts are appearing that the top. I guess you can't do anything about that and it's down to the people that create the XML?

/me clicks install.

Slapyo
05-24-2004, 06:30 AM
ya, its some weird thing with how the RSS script processes the feed. i've noticed that as well.

Milez
05-26-2004, 11:53 AM
I would give blood for an rss feed that had more than a simple 1 line description with a link. I want to keep users on my forum. I would gladly pay for this service.

Slapyo
05-26-2004, 06:59 PM
<a href="http://www.syndic8.com" target="_blank">http://www.syndic8.com</a>

might find something there.

maestrosdelweb
05-27-2004, 02:47 AM
Hi. The w3c accepted ATOM feed format as the standard (blooger is also promoting them).

Any chance of an ATOM version of this script for the future?

Slapyo
05-27-2004, 06:39 AM
as of right now i don't plan on doing any more to the script till i finish up school. have a few weeks left till i graduate then i will have some time. but there were a couple things i was thinking about adding in. one was adding in the ability to use RDF feeds, so this would go along with that, i could make an option for what kind of feed it is. will keep this in mind.

maestrosdelweb
05-27-2004, 07:04 AM
Great. I'll check the code to see if I can help. Best regards and good luck with school.

Intex
06-02-2004, 11:21 AM
I've had this running for a couple of weeks now and everything works well. I think it could be further improved by:

Stripping the HTML tags off some the thread titles before posting. This doesn't particularly look very good. Maybe there's a hack that will parse HTML on thread names?

The RSS feeds are simply pulled from the respective website. However, every newsfeed will have the latest information at the top of the XML, which is normal bahaviour. However in a forum environment, this is undesirable because the top most item gets posted into the forum first and later threads get posted above as they're newer. The script would need to revserve this to get the desired effect, i.e. newest threads at the top of the forum.

Having an option to not count posts from the bot that's being used to post. Maybe there's a hack for this too?

Slapyo
06-02-2004, 02:47 PM
in rss_update.php:

FIND:

$rss_title = html_entity_decode($rss_title, ENT_NOQUOTES);
$rss_description = html_entity_decode($rss_description, ENT_NOQUOTES);


ADD, ABOVE:

$rss_title = strip_tags($rss_title);
$rss_description = strip_tags($rss_description);


that should fix HTML tags showing up in both the title and in the descritpion. i know about the way the feed is pulled, parsed, and posted. i will have to look into a work around so that it gets posted the right way and parses the RSS from the bottom up.

the function used to insert posts was one that vB already had built it. this uses the exact same function that vB does to insert posts. that also includes upping he post count and stuff like that. removing the post count would take some time. a quick fix for that is to make that forum not have post counts increase. but then any normal user that replies to a post won't get a post.

Intex
06-02-2004, 02:58 PM
Slapyo - thx for the info. I'll make adjustments to the code to get rid of the HTML stuff. I've already disabled posts for the forum where RSS feeds are put in.

Good job - thx :).

The Realist
06-02-2004, 08:05 PM
Installed and working 100%.

Nice hack.

The Realist
06-02-2004, 08:52 PM
Can someone or even the developer of this hack take a look at my request here:

https://vborg.vbsupport.ru/showthread.php?t=65767

It will come in handy for anyone using this hack.

Slapyo
06-03-2004, 03:05 AM
i just replied to your post.

The Realist
06-03-2004, 08:29 AM
Thanks Slapyo but Im no coder. Any available for this?

Slapyo
06-03-2004, 01:19 PM
once i graduate in a couple weeks (june 13) i will have some time to be able to look into this further.

Intex
06-03-2004, 01:20 PM
Slapyo - good luck with everything. Any help in the future will be appreciated.

clangrounds.com
06-03-2004, 07:35 PM
I had to delete the remains of a past failed RSS install, but it worked like a charm after that! I've been creating different users/characters to report on the different news sections, and it's kind of funny since my members think they're real people posting all those threads. ;)

Slapyo
06-03-2004, 08:46 PM
lol cool.

Intex
06-04-2004, 10:16 AM
After a bit of searching, I've found a basic way to exclude selected forums from the new posts listing.


Search.php find:

WHERE forumid IN(" . implode(', ', $forumids) . ")


Replace with:

WHERE forumid IN (". implode(',', $forumids).") AND forumid NOT IN(x)

X above should be replaced with the forum you want to exclude. If you want to exclude more than one forum, then simply separate each forum with a comma.

However, this would mean that your members who do want to see new posts regarding these RSS forums, won't see them. A solution to this would be to create a separate search.php file. Just copy the existing search.php and rename it to something like search-rss.php.

You can then add another link to your NAVBar or whereever you like to call this particularly search script and show new posts, i.e.

http://www.yourdomain.com/forum/search-rss.php?do=getnew


I know this isn't an ideal solution, but it's a solution nonetheless. As already discussed, it would be better to have it prompt you if you want to include RSS feeds. Then again, for users that don't and never do, this would be undesirable as well :).

I've just changed my NAVBar menu so that 'New Posts' was renamed 'Posts' and this has a drop-down menu, which allows me to select 'New Posts (No RSS)', 'New Posts (with RSS)' , 'Mark Posts Read' etc.

Hope you find this useful until another solution is developed. Maybe it will also help Slapyo on the query side anyway.

The Realist
06-04-2004, 10:24 AM
I'll stick mine all in a drop down menu, makes life a lot easier. For the time being I have excluded all RRS posts from the new posts search.

Laters

PAINTBALLM
06-06-2004, 05:52 PM
before i install this. one question.

Can I make a category on my forums JUST for news feeds, and have it post a new thread for every new topic? (for people to discuss and such).

Let me know

Intex
06-06-2004, 06:00 PM
Not sure what you mean by category. If you mean post into a particular forum or sub-forum, then yes - this is exactly what the hack does. It will pull feeds from other websites and it will create a new thread for every headline.

For example, I have a forum called RSS Feeds which has many sub-forums. I've created numerous bots that retrieve content from other websites and it automatically posts threads into each of these sub-forums.


before i install this. one question.

Can I make a category on my forums JUST for news feeds, and have it post a new thread for every new topic? (for people to discuss and such).

Let me know

PAINTBALLM
06-06-2004, 06:43 PM
Thats what I mean, sorry. Nice... Installing now ;)

PAINTBALLM
06-06-2004, 07:22 PM
wjen I run rss.php I get

Parse error: parse error in /www.pbmessage.com/forums/includes/functions_newpost.php on line 1188

Fatal error: Call to undefined function: build_new_post() in /www.pbmessage.com/forums/includes/RSS/rss_update.php on line 103

The Realist
06-06-2004, 08:27 PM
Recheck your edits of the files again, you have done something wrong.

rsuplido
06-07-2004, 07:41 PM
Cool Hack! Here'a a suggestion though. Can it be done so that clicking on a thread will redirect to a page split into two frames horizontally? the main news is at the top, the thread discussion is at the bottom. Possible?

Deimos
06-09-2004, 12:32 PM
Hmm i've got a problem here :(
After it's all installed, no errors show up, but when I goto Enable the mod, every user (Including me) who accesses the forums shows logged in AS the news bot? And the forum listing doesn't show up AT ALL
If I disable the mod, it returns to normal................!?

rsuplido
06-09-2004, 02:47 PM
Anyone having the problem of the last entry getting added again and again?

Intex
06-09-2004, 03:04 PM
Yep, I'm having that problem but only with some RSS feeds that I pull into certain forums. I think it might be something to do with the website itself and the way they are presenting the information. For instance, if they update the date of a particular news heading, it's classed as new by the RSS hack script.

Slapyo - I know you built some form of checking into your script. Is this based on thread title, date or both. I would recommend it's changed to search for the title, so a search is done beforehand on existing forum threads. That way, dupilcation could be avoided. Maybe when you've finished your studies :).

rsuplido
06-09-2004, 04:56 PM
Yep, I'm having that problem but only with some RSS feeds that I pull into certain forums. I think it might be something to do with the website itself and the way they are presenting the information. For instance, if they update the date of a particular news heading, it's classed as new by the RSS hack script.

Slapyo - I know you built some form of checking into your script. Is this based on thread title, date or both. I would recommend it's changed to search for the title, so a search is done beforehand on existing forum threads. That way, dupilcation could be avoided. Maybe when you've finished your studies :).
well, I tried changing that line to just check for the title and still I'm getting duplicates whenever the script runs. I was going to put this rss feature on live at my site but this bug just hinders me from doing so. :(

Slapyo
06-10-2004, 03:55 AM
Hmm i've got a problem here :(
After it's all installed, no errors show up, but when I goto Enable the mod, every user (Including me) who accesses the forums shows logged in AS the news bot? And the forum listing doesn't show up AT ALL
If I disable the mod, it returns to normal................!?
did you make sure that you modified the files like noted in the installation file? i haven't noticed this problem with the script myself.

Slapyo
06-10-2004, 03:56 AM
Yep, I'm having that problem but only with some RSS feeds that I pull into certain forums. I think it might be something to do with the website itself and the way they are presenting the information. For instance, if they update the date of a particular news heading, it's classed as new by the RSS hack script.

Slapyo - I know you built some form of checking into your script. Is this based on thread title, date or both. I would recommend it's changed to search for the title, so a search is done beforehand on existing forum threads. That way, dupilcation could be avoided. Maybe when you've finished your studies :).
the rss script which goes through and checks for old posts checks for the title and the date. i haven't touched this from the original script. but i do know that it checks the title and the date.

Deimos
06-10-2004, 09:17 AM
did you make sure that you modified the files like noted in the installation file? i haven't noticed this problem with the script myself.

Yep, I went through it all step by step. :(

Deimos
06-10-2004, 09:37 AM
Ok hmm, I removed all the database entries, reuploaded all the files and tried again
When I enable the RSS Feed, I get this error

Fatal error: Call to undefined function: build_new_post() in /home/deimos/public_html/forums/includes/RSS/rss_update.php on line 103

Any ideas? heh

Slapyo
06-10-2004, 04:23 PM
hrm ... i'm not sure. i'm sure that you did edit the files and upload everything to where it needs to go. but the only thing i could say is to double and triple check it.

also, do you have any other hacks installed? a while back someone installed this on 2 instances of vB. one was clean and one was hacked. he had a problem with the hacked one that we were never able to solve, and it was installed properly.

rsuplido
06-10-2004, 04:40 PM
I decided to modify the program instead. I added a 'rss_url' in the threads table so I can use that as the key for comparing. I then changed the loop code in rss_update.php to compare each record via an SQL call, comparing the rss_url field. I also wanted a url column so I can easily do a news listing on my main page and have the link ready.

It's all working now. Thanks for this hack.

andyhodges
06-11-2004, 12:21 AM
I am getting duplicates again... very annoying.. it's adding and adding... is there a fix for this? If so, can somebody post the instructions?

-Andy