spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / perl / scripts / bbi_rss2html.html

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

After managing to get versions of your scripts working as BBEdit filters, I decided to tackle getting rss2html.pl working as a BBEdit include file.

The format is somewhat similar to Server Side Includes in appearance, but the functionality it somewhat different, due to the way BBEdit uses AppleEvents to send data to MacPerl.

AppleEvents expects data to be in key/value pairs, which means that the contents @ARGV must be coerced to a hash in Perl. First, however, one sets up the BBEdit include statment, thus:

<!-- #bbinclude rss2html.pl #val1#="http://somesite.com/somefile.rdf" --> <!-- end bbinclude -->

The "end" statment is needed so that the whole include statement becomes "persistant", that is, it doesn't get replaced by the results of the script, but acts as a container for it.

Since @ARGV doesn't hold the single value the original script expects, line #19:

die "Usage: rss2html.pl (<RSS file> | <URL>)\n" unless @ARGV == 1;

will always cause the script to die. Until I find some other test, I've just pulled this line from the script.

The following version does some minimal reporting in the form of HTML comments, and is also cleaned-up in the way it outputs HTML (I think that the formatting I'm using here is a little more consistant, and I'll probably work on making it even more so). One insignifigant modification is that I like the tables slightly narrower (184 vs. 200 pixels). My justification for this requires more explanation than I can fit in a single email. I also don't like the way that text wraps in either NS or IE when <li> is used on its own. One signifigant change is that I've made the output look more consistant between NS and IE. These are mostly tweaks to the HTML, and not to the script itself.


Produced by Jonathan Eisenzopf and

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint

URL: http://www.webreference.com/perl/scripts/