Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

Reply
 
Thread Tools
NEW Modified RSS News Feed Hack Details »»
NEW Modified RSS News Feed Hack
Version: 1.00, by Slapyo Slapyo is offline
Developer Last Online: Apr 2013 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 04-12-2004 Last Update: 06-22-2004 Installs: 146
 
No support by the author.

Hack originally posted by: Xyphen - RSS News Feed Hack
Modified by: wolfstream - Modified RSS News Feed Hack

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!
- CNET.com
- BBC
- Wired News
- The Register
- Ars Technica
- All Headline News

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #352  
Old 07-12-2004, 03:32 PM
sjau sjau is offline
 
Join Date: Apr 2003
Location: Switzerland
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@ slapyo

all I can say is that it fetched the first time data from "my" news feed and never since on 3.0.2. Not even when triggered manually from the admin center.
Furthermore where can I change that text "View entire article?"?
Reply With Quote
  #353  
Old 07-12-2004, 09:41 PM
mrboz's Avatar
mrboz mrboz is offline
 
Join Date: Feb 2003
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i have the same problem with it not updating too.

i have tried 2 different feeds from the bbc news website and another feed from a different site.

the first time you get the news it works very well, but it doesn't update anymore. i have checked the bbc feeds and they have been updated and i tried another feed with news on it and that didn't work at all.
Reply With Quote
  #354  
Old 07-13-2004, 01:14 PM
Slapyo Slapyo is offline
 
Join Date: Feb 2004
Location: Rancho Cucamonga
Posts: 370
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hrm, i'm not sure. everything should be working fine as no major updates have been done to anything that would affect the script. i'll look at it some more.

@sjau, you can edit the View entire article in rss_update.php
Reply With Quote
  #355  
Old 07-13-2004, 03:08 PM
rsuplido rsuplido is offline
 
Join Date: May 2002
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here's a workaround that I did to parse VB RSS2 streams (item titles with CDATA):

Open <forum dir>/includes/RSS/class.RSS.php (please backup original first)

Look for:
Code:
$channelCount = preg_match_all("|<channel>(.*)</channel>|iUs",$data,$channels,PREG_SET_ORDER);
Replace with:
Code:
$channelCount = preg_match_all("|<channel*>(.*)</channel>|iUs",$data,$channels,PREG_SET_ORDER);
Look for :
Code:
			if(preg_match_all("|<title>(.+)</title>|iUs",$itemData,$match,PREG_SET_ORDER))
			{
				$title = $match[0][1];
				$this->CHANNELS[$channelID]['ITEMS'][$itemID]['TITLE'] = "$title";
			} else {
				$this->CHANNELS[$channelID]['ITEMS'][$itemID]['TITLE'] = "";
			}
Replace with:
Code:
			if(preg_match_all("|<title><\!\[CDATA\[(.+)\]\]></title>|iUs",$itemData,$match,PREG_SET_ORDER))
			{
				$title = $match[0][1];
				$this->CHANNELS[$channelID]['ITEMS'][$itemID]['TITLE'] = "$title";
			} else {
				if(preg_match_all("|<title>(.+)</title>|iUs",$itemData,$match,PREG_SET_ORDER))
				{
					$title = $match[0][1];
					$this->CHANNELS[$channelID]['ITEMS'][$itemID]['TITLE'] = "$title";
				} else {
					$this->CHANNELS[$channelID]['ITEMS'][$itemID]['TITLE'] = "";
				}
			}
Look for:
Code:
$itemCount = preg_match_all("|<item>(.*)</item>|iUs",$channelData,$items,PREG_SET_ORDER);
Replace with:
Code:
$itemCount = preg_match_all("|<item*>(.*)</item>|iUs",$channelData,$items,PREG_SET_ORDER);
I did the these changes to parse another VB3 enabled site and it's been working for several weeks now.

Regards.
Reply With Quote
  #356  
Old 07-13-2004, 07:04 PM
mrboz's Avatar
mrboz mrboz is offline
 
Join Date: Feb 2003
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it seems to be only "BBC News" feeds that are not updating. i'm using a reuters feed now and it's working perfectly
Reply With Quote
  #357  
Old 07-14-2004, 01:46 AM
jribz jribz is offline
 
Join Date: Oct 2003
Posts: 66
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello,

First I'd like to thank everyone invoilved in this hack, very nice work.

Secondly I have a question. I am using the hack flawlessly to post from a custom rss feed from my own site which delivers the entire article, not just a link to it.

The problem is the bot delivers the article in one large block of text without formatting it onto paragraphs and line breaks. When the rss feed is viewed in a reader such as Sharpreader it formats fine.

Is there any way to get this to format in a more user friendly fashion for those us of who actually have live rss feeds with the entire story inside them?

If someone is willing to take a look I will PM the feed url to you as well as my site url.

Thanks for your time.
Reply With Quote
  #358  
Old 07-14-2004, 02:47 AM
Slapyo Slapyo is offline
 
Join Date: Feb 2004
Location: Rancho Cucamonga
Posts: 370
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you can PM me the feed if you like or you can just post it on here. i'm sure anyone that can help will.
Reply With Quote
  #359  
Old 07-14-2004, 03:11 AM
jribz jribz is offline
 
Join Date: Oct 2003
Posts: 66
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, thanks for the reply.

Rather than get into a PM exchange, I'll just post the info here since it may help others as well. :nervous:

The site I run is Xbox Solution located at http://www.xboxsolution.com

We have two rss feeds, one that will post a link and another that will write out the story.

First RSS Feed (Link Only): http://www.xboxsolution.com/backend.php

Second RSS Feed (Full Story):http://www.xboxsolution.com/index.rss

I am using the second RSS feed for the bot - and all is well except that when the bot posts the story it posts everything in one block, no line breaks.

If you point an rss reader such as Sharpreader to http://www.xboxsolution.com/index.rss you will see that the output is fine, with line breaks where needed,

Just wondering if there is any way to resolve this.

The forum that my bot posts in is here: http://talk.xboxsolution.com/forumdisplay.php?f=48

The bot's user ID is here: http://talk.xboxsolution.com/member.php?userid=28095

Thanks for the help!
Reply With Quote
  #360  
Old 07-14-2004, 06:22 AM
Slapyo Slapyo is offline
 
Join Date: Feb 2004
Location: Rancho Cucamonga
Posts: 370
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

here is where i ran into the same problem when coding this. i couldn't find out how to insert a breakline. everytime i put in /r/n it would actually put those characters into it. this was for inserting the description then 2 lines down putting the link. i had to come up with a work around for that.

Code:
Open up your replacement variable manager (in admincp -> styles & templates -> replacement variable manager) and add the following entry:
Style: [select whichever style you are using]
Search for text: {br}
Replace with text: <br />
Reply With Quote
  #361  
Old 07-14-2004, 06:35 AM
DS MrSinister DS MrSinister is offline
 
Join Date: Dec 2002
Location: the burgh
Posts: 553
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

looks like a kewl hack... i will giive it a try!!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:43 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02926 seconds
  • Memory Usage 2,316KB
  • Queries Executed 27 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (7)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete