|
|
|
|
Thread Tools | Display Modes |
03-20-2003, 11:22 PM | #1 |
Scooby Guru
Member#: 518
Join Date: Nov 1999
Chapter/Region:
NESIC
Location: Pelham, NH USA
Vehicle:762 PGT Impreza L, Elantra GT Sport |
RSS newsfeed created for SpecialStage.com now available on Trunkmonkey.com.
Since SpecialStage.com didn't have an RSS newsfeed available I set up a scraper to pull headlines off their news archive page and convert them to an RSS feed. The feed info is available at Syndic8:
http://www.syndic8.com/feedinfo.php?FeedID=24781 The actual scraped RSS feed is available at Trunkmonkey.com: http://www.trunkmonkey.com/feeds/specialstagenews.xml To see the feed in action, check out Trunkmonkey.com, scroll down and check out the Special Stage News block on the left. If you run a CMS like PostNuke, Movable Type, Blogger, etc. you can add RSS newsfeeds to your Web site! If you want to add the Special Stage RSS newsfeed to your site, feel free to point your scripts at my scraped feed! Team Updates | FAQ | Gallery | Birth For the geeks among you, here is the code if you want to scrape it yourself or set up a scraper for another site (you'll need to tweak it to match the site's HTML): Code:
#!/usr/bin/perl use strict; use LWP::Simple; use HTML::TokeParser; use XML::RSS; use CGI; my $content = get( "http://www.specialstage.com/viewall2.asp" ) or die $!; my $stream = HTML::TokeParser->new( \$content ) or die $!; my $rss = XML::RSS->new( version => '0.9' ); $rss->channel(title => "www.specialstage.com", link => "http://www.specialstage.com/", description => "SpecialStage.com - The North American Rally Resource", language => "en-us"); $rss->image(title => "specialstage.com", url => "http://www.specialstage.com/images/header.jpg", link => "http://www.specialstage.com/"); my ($tag, $headline, $url); $tag = $stream->get_tag('strong'); $tag = $stream->get_tag('/p'); # First indication of a headling - A <strong> tag. while ( $tag = $stream->get_tag("a") ) { $url = $tag->[1]{href} || "--"; if ( $url =~ /StoryID/ ) { $headline = $stream->get_trimmed_text('/a'); # $headline = CGI::escape($headline); $url = 'http://www.specialstage.com/'.$url; $url = CGI::escapeHTML($url); $rss->add_item( title => $headline, link => $url); } } $rss->save("/var/www/html/www.trunkmonkey.com/feeds/specialstagenews.xml");
* Registered users of the site do not see these ads.
|
03-21-2003, 11:52 AM | #2 |
Scooby Specialist
Member#: 18791
Join Date: May 2002
Chapter/Region:
MWSOC
Vehicle:2002 WRX wagon Silver! |
Sweet!
I just set my personal PHPws setup to pull it. It's about time I got it doing something useful... -Mark |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
2006 Impreza, Legacy, and Outback brochures now available at Subaru.com | Raxy | General Community | 5 | 11-01-2005 10:43 PM |
Picasa now available on Google | -=C=- | Off-Topic | 7 | 06-07-2005 03:16 PM |
STi now available at Subaru.com | MK19 | STi Forum Archive | 3 | 05-21-2003 03:15 PM |
('93-'01) Starting my photography portfolio on Trunkmonkey.com...comments/suggestions please! | Sean | Impreza Forum | 7 | 05-24-2001 01:39 AM |