vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Article Bot (https://vborg.vbsupport.ru/showthread.php?t=67078)

Velocd 07-10-2004 10:00 PM

Article Bot
 
Article Bot
by velocd


Article Bot is a script that allows you to assign a user account (preferably an exclusive one) to an article bot that will post RSS feeds in select forums at designated intervals. These articles are derived from RSS (Really Simple Syndication) feeds.

RSS files are assigned to article bots, as well to individual forums, which in turn directs what, when and where your article bot will post.

Features
  • Works with RSS versions: 0.9x, 2.0, 1.0, and Atom 0.3
  • AdminCP interface for adding/modifying/deleting article bots & rss feeds
  • Designate intervals (in minutes) to each RSS feed for when your article bot will post them.
  • Requires only 1 file edit (admincp/index.php), allowing ease of upgrading your vBulletin
    without having to remodify files.
  • Easy to install. Works best in conjunction with crontab (contab help is inside install.html)

News
  • 7/25/04 - Version 1.1 Released
    • Bug Fixes
      • Replaced htmlspecialchars() with htmlentities() in articlebot.php to fully convert special entities from descriptions.
      • Added trim() to thread titles, to prevent double threads from being posted that are merely off by whitespace.
      • New table articlebot_rss_cache for storing a copy of article bot threads, for quicker checking of doubles when posting new threads.
      • Threads are checked in articlebot_rss_cache, so you can permanently remove them from the thread table (you don't have to "soft delete") without worrying about the bot replicating them.
      • Other minor bugs.
    • Features
      • New installer/upgraders for doing the SQL part automatically.
      • Added "label" field to add/modify RSS interface, that allows you to tag a label, e.g. [yahoo], to the beginning of threads, unique to each RSS feed. This might help for better distinction of RSS feeds.
      • Added an option to toggle on/off of building similar threads per RSS feed. Some RSS feeds could hault the script if the building of similar thread results for that feed takes too long (maybe the article thread title is too vague, and matches a lot of results--my guess is it's only a problem on large forums).
      • Added an option to toggle on/off skipping of articles that don't contain descriptions.
      • Regular expression search and replace for article titles and descriptions. This grants you much flexability to filter out things you don't want in your titles or descriptions (given you have some regex experience, I will try to post some patterns in due time.. feel free to add yours ;))
  • 7/11/04 - Version 1.0 Released

Upgrading
  • To upgrade, reupload the new PHP and MagpieRSS parser files to their places on your server. Upload upgrade_vx-x (replace the x's with the version you are upgrading to) to /path/to/forums/admincp/, and then execute that script.

Files
  • 3 screenshots attached
  • articlebot_v1.zip
    • install.html, logo.gif
    • articlebot_admin.php
    • articlebot/
      • rss_cache.inc
      • rss_fetch.inc
      • rss_parse.inc
      • rss_utils.inc
      • extlib/
        • Snoopy.class.inc

RSS Feeds

There are several in the install.html, but if you're looking for more than you could ever want, check out NewsIsFree's directory:

http://www.newsisfree.com/sources/bycat/


Remember to click install if you use this hack. ;)

Also be sure to read through the what you haven't of the thread before asking a question, for it may have been answered.

Velocd 07-11-2004 08:53 PM

Ah yeah, enjoy the modification. ;)

MindTrix 07-11-2004 09:42 PM

This looks great well done and thanks, Does this mean we have to like write articles or can it automatically pull them from another site or something?

Velocd 07-11-2004 10:21 PM

It pulls articles from RSS feeds. RSS is a xml format primarily used for syndicating news. Many news related sites provide RSS files of their recently posted articles so their readers can use an RSS aggregator (e.g. http://www.sharpreader.net) to read the data.

With PHP's XML libraries, parsing RSS is done very easily.

Sample RSS:
http://rss.news.yahoo.com/rss/topstories

Anyhow, you first create an article bot, by assigning it a user it will control.

You add an RSS feed by specifying the path to the RSS file, the article bot it applies to, the forum the thread will be posted in, and an interval (in minutes) that a new thread will be posted.

It's preferred that you use a crontab to execute the articlebot.php file, every couple hours or so. The script will work from the bottom of the RSS file (oldest articles) to the top (latest articles). It will post the title of the article as the thread subject, and then the RSS description as the body content. It then tags the URL to the actual full article.

I've had it running on my forum for about 2 weeks, and it works quite well. Make the intervals quite large, like every 5 hours, or else you'll have a flood of bot threads on your forum. ;) This of course depends on the RSS feed and how often the news source updates it.

Hopefully I didn't make things more convoluted. :rolleyes:

Dan 07-11-2004 11:45 PM

Nice I like this a lot :)

Erwin 07-12-2004 01:09 AM

There is another hack just like this one that I installed a month or two ago. :) How is this different to that one? Just wondering.

Velocd 07-12-2004 01:45 AM

Hm, I didn't know others existed.

Well, it's different in that it's coded by another person. ;)

Feature wise, you'll just have to try it out. Article bots can have unlimited RSS feeds assigned to them, and RSS feeds can be in multiple forums. Meaning, 1 article bot can post in many forums. Not sure if the other RSS mods are restricted of this.

It's very query efficient also.

alkatraz 07-12-2004 01:47 AM

cool

Is there a way to create an RSS feed from your site, for other sites with this hack? (ie: new events on my forum automaticaly get RSS'd to other sites)

Reeve of shinra 07-12-2004 01:48 AM

alkatraz - I could be mistaken but I believe thats a default feature of vb3. Check the online manual for it.

alkatraz 07-12-2004 02:57 AM

crazy, just checked the vb3 manual..

thx

nexialys 07-12-2004 09:12 AM

would be good from Erwin to post a link, so we can all compare!

Natch 07-12-2004 11:27 AM

Erwin is talking about Slapyo's New Modifies RSS feed hack - there is a search button for just such an occasion ;) :D

DrkFusion 07-12-2004 01:05 PM

This is a great hack (y)

ranger2kxlt 07-12-2004 02:54 PM

Ok stupid question, where do you get RSS feeds from? I mean what site will this info be pulled from? I run a F0RD website, where would i find info on stuff like that?

*sorry disregard opened the zip and you have lots of feeds for me :-D

Blackbeard 07-12-2004 03:38 PM

Silly question time, but would this work on 3.01 as iam not planning on updating yet

Sypher 07-12-2004 04:30 PM

nice job! *clicks install*

Velocd 07-12-2004 06:22 PM

Quote:

Originally Posted by Blackbeard
Silly question time, but would this work on 3.01 as iam not planning on updating yet

This hack will work on all vBulletin 3 versions.

Gryphon 07-12-2004 08:22 PM

It doesn't seem to like table prefixes. :ermm:

Appears to be line 377 in articlebot_admin.php

Replace
Code:

        FROM user
With
Code:

        FROM ".TABLE_PREFIX."user

GamerzWorld 07-12-2004 09:43 PM

How do we find RSS sites :/ Think you could post a list of sites please?

Gryphon 07-12-2004 09:52 PM

It would depend on what you are interested in. If you want gaming, try your favorite fansite and look for their RSS link. If you want world news, head to a news website and find their link.

There are tons of links, hard to just post some that you may or may not like. He already gave examples in the install file.

*edit
Velocd, how about the option to prefix the titles with something we can use to identify the different feeds. Like a feed from Blues could be [Blues] Morning Q&A's and ShackNews could show as [Shack] Game Reviews.

The cron also shows up in the whois online as the base path.

gmarik 07-12-2004 10:25 PM

Great - love RSS!

ranger2kxlt 07-13-2004 12:07 AM

Ford blogs? are they out there?

Velocd 07-13-2004 02:49 AM

Google is your best bet to find blogs. There are thousands out there, search around. use keywords like Movabletype, Los Angeles Blogs, Xanga.com, Blogger, etc. If you want more traditional sources, find large news sites, like BBC, that provide RSS files.

Quote:

It doesn't seem to like table prefixes.

Appears to be line 377 in articlebot_admin.php
Hm, thought I got them all. Will make the change.

Quote:

Velocd, how about the option to prefix the titles with something we can use to identify the different feeds. Like a feed from Blues could be [Blues] Morning Q&A's and ShackNews could show as [Shack] Game Reviews.
Ah, although I don't believe the RSS parser I use (MagpieRSS) grabs that information.

I'll take a second look though. ;)

Quote:

The cron also shows up in the whois online as the base path.
Given the cron has the same IP as your server, you could probably do a comparison in online.php with $_SERVER["SERVER_ADDR"] and exclude that entry. I'll look into this also. Expect an update probably Sunday.

romeshomey 07-13-2004 05:40 AM

Im having a problem and not sure what it is.
Code:

Warning: chdir(): No such file or directory (errno 2) in /home/drewster/public_html/forums/articlebot/articlebot.php on line 42

Warning: main(./global.php): failed to open stream: No such file or directory in /home/drewster/public_html/forums/articlebot/articlebot.php on line 43

Fatal error: main(): Failed opening required './global.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/drewster/public_html/forums/articlebot/articlebot.php on line 43

Im really not sure what to put in the articlebot.php which Im sure is why Im having that error when I try to execute it.

Code:

chdir('home/drewster/public_html/forums');
require_once './global.php';

include_once './articlebot/rss_fetch.inc';

Anyone see what I might have wrong?

romeshomey 07-13-2004 05:52 AM

I tried this
Code:

chdir('/home/drewster/public_html/forums/');
require_once 'home/drewster/public_html/forums/global.php';

include_once 'home/drewster/public_html/forums/articlebot/rss_fetch.inc';

Still getting an error, but not sure what I have wrong...
Code:

Warning: main(home/drewster/public_html/forums/global.php): failed to open stream: No such file or directory in /home/drewster/public_html/forums/articlebot/articlebot.php on line 43

Fatal error: main(): Failed opening required 'home/drewster/public_html/forums/global.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/drewster/public_html/forums/articlebot/articlebot.php on line 43


romeshomey 07-13-2004 05:54 AM

Ok, no errors now, but also don't see anything when the php runs... Is that normal?

http://www.insidersportszone.com/for...articlebot.php

romeshomey 07-13-2004 06:13 AM

Hmm, something isnt right. Its either not reading the feed I have in there or isnt working altogether. Not sure which.

I have this feed running on other sites, so should work here as well, but isnt.

http://xml.newsisfree.com/4/43/4306f...6d8c1dd74c.xml

romeshomey 07-13-2004 06:52 AM

Ok, well its working as far as showing a feed on the forums.

Problem now is, it looks like this..

Code:

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

Venezuela was eliminated from the Copa America after tying Bolivia 1-1 Monday. <br clear=all>

http://www.newsisfree.com/click/i,43984701,1471,rss/

How do I get it to not show the <br clear=all> ??

romeshomey 07-13-2004 10:07 AM

Is there a way to get it to read the html in the RSS feeds?

I have HTML enabled in the forums, but when my Bot posts the HTML in the feeds stil show as <b> and </b> etc...

Is there a way to enable it to read the HTML so the bold is bold and etc?

gmtalk 07-13-2004 10:23 AM

Quote:

Originally Posted by ranger2kxlt
Ford blogs? are they out there?

We will be having news feeds from two of our sites by the end of this month.

I have not seen any others as of yet that are Ford Specific. I have not been looking too hard, but i have had a look.

Velocd 07-13-2004 02:23 PM

Quote:

Is there a way to get it to read the html in the RSS feeds?

I have HTML enabled in the forums, but when my Bot posts the HTML in the feeds stil show as <b> and </b> etc...

Is there a way to enable it to read the HTML so the bold is bold and etc?
I will look into this. I would have suspected that enabling HTML on the forums would show the HTML, but guess not. It's a security hazard to enable HTML for posts, btw, and not recommened.

I'm thinking I'll probably throw in strip_tags() to remove the HTML tags. Good RSS feeds don't provide HTML anyway, so you might look for others.

romeshomey 07-13-2004 03:41 PM

All of ESPN's feeds have HTML, and seeing as Im a sports forum, then I dont have alot of choices to choose from as far as getting the latest up to date feeds in those areas.

Thanks though, I'd love to get those tags either removed or working, either or. Let me know if or when you figure out how to remove or enable them :)

I love the addition of the Bot, although he may surpass the world posting records! lol

Gryphon 07-13-2004 05:34 PM

Quote:

Originally Posted by Velocd
Ah, although I don't believe the RSS parser I use (MagpieRSS) grabs that information.

I'll take a second look though. ;)

I mean in addition to adding the URL and the time limit and the fetch limit and initially skip options, add a field that the board admin can specify as prefix for the titles, like Poll: or Moved: or Sticky:, in this case [News] or [Blues]. Something that people can use to identify that it is an automated post, or for myself, use to parse out onto other pages.

BTW romeshomey, you should really edit previous posts rather than posting a stream of them.

romeshomey 07-13-2004 05:43 PM

Quote:

Originally Posted by Blackjack
BTW romeshomey, you should really edit previous posts rather than posting a stream of them.

What do you mean by that? The purpose of the addition was so that I or my other moderators didnt have to spend time looking for and posting articles for readers into the forums.

Im not sure what you are trying to tell me to edit..

rsuplido 07-13-2004 06:04 PM

Just wondering what version of RSS can this hack handle. The other hack can only handle RSS 0.91. Can it parse RSS 2.0, like that of VB3's?

Thanks.

romeshomey 07-13-2004 06:15 PM

Quote:

Originally Posted by rsuplido
Just wondering what version of RSS can this hack handle. The other hack can only handle RSS 0.91. Can it parse RSS 2.0, like that of VB3's?

Thanks.

Yes it can. All of my RSS feeds are 2.0 and are working fine. Just wish the html special characters didnt show as well.

romeshomey 07-13-2004 06:23 PM

I don't see anything on this one, it wont parse anything if nothing is there for it to parse.. You sure the link is right? http://www.mini2.com/news/rss.php

Then this one should work fine. http://www.motoringfile.com/rss.xml

Everytime I make an edit in my ACP to add or update a feed for my bot, I have to run the forums/articlebot/articlebot.php manually by loading the page before my feeds will start posting.

So try that. But your 1st feed link is completely blank.. It might have something to do with it not being an XML extension.

rsuplido 07-13-2004 06:26 PM

Quote:

Originally Posted by romeshomey
Yes it can. All of my RSS feeds are 2.0 and are working fine. Just wish the html special characters didnt show as well.

Thanks for the info.

Suggestion: can this hack handle ATOM in the future? ;)

Velocd 07-13-2004 06:47 PM

Quote:

Just wondering what version of RSS can this hack handle. The other hack can only handle RSS 0.91. Can it parse RSS 2.0, like that of VB3's?

Thanks.
MagpieRSS handles the following, as noted in the install.html:

RSS 0.9x, RSS 2.0, RSS 1.0, and Atom 0.3

Quote:

Very nice hack, installed and testing at the moment, however I've got a problem (and it started off so well too!).

Anyway, I have several feeds, all but two work. If I exclude these two feeds, the other feeds (3 other feeds) work 100%.

The error I get is this (when I fun from command line):
How strange. articlebot.php requires functions_search.php only if you have the similar thread feature enabled, so that similar threads are generated for the threads.

Your error would probably disappear if you commented the fetch_similar_threads() function call in articlebot.php, like so:

PHP Code:

// $similarthreads = fetch_similar_threads($article['title']); 

I'll make a modification to that hack that allows you to toggle whether to grab similar threads per RSS entry (so you can disable it for RSS files that give errors).

Quote:

I mean in addition to adding the URL and the time limit and the fetch limit and initially skip options, add a field that the board admin can specify as prefix for the titles, like Poll: or Moved: or Sticky:, in this case [News] or [Blues]. Something that people can use to identify that it is an automated post, or for myself, use to parse out onto other pages.

BTW romeshomey, you should really edit previous posts rather than posting a stream of them.
yeah, I'll incorporate this feature. ;)

Quote:

Everytime I make an edit in my ACP to add or update a feed for my bot, I have to run the forums/articlebot/articlebot.php manually by loading the page before my feeds will start posting.
This isn't a bug, but just how it is. When you add an RSS feed, the "next post" time will be the time it was added, plus the interval in minutes. So you have to wait.

If you set the interval to 1 minute, then it should proceed automatically. I'm assuming you are using a cron job.

Quote:

Thanks though, I'd love to get those tags either removed or working, either or. Let me know if or when you figure out how to remove or enable them
I must have forgot, but the code is currently using strip_tags() to remove basic HTML tags. Whether this removes XHTML or more extensive, I'm not sure. I'll look into a preg_replace() expression that will remove HTML tags.

romeshomey 07-13-2004 07:18 PM

Quote:

Originally Posted by Velocd
I must have forgot, but the code is currently using strip_tags() to remove basic HTML tags. Whether this removes XHTML or more extensive, I'm not sure. I'll look into a preg_replace() expression that will remove HTML tags.

Thanks..

I also noticed, it wont post an article unless the article has a 'discription' in it. It wont post just a title and link. If the feed doesnt include discription tags, it seems to skip those articles.

Not that I need it too, but just pointing that out.


All times are GMT. The time now is 04:53 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02041 seconds
  • Memory Usage 1,853KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_code_printable
  • (1)bbcode_php_printable
  • (16)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete