spacer

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

home / experts / perl / scripts / bbi_rss2html.html

Developer News
ActiveState Debuts Open Source Business Suite
Salesforce Offers Visual App Builder
Codesion Steps Out From CVS's Shadow

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


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

webref The latest from WebReference.com Browse >
Use Web Caching to Make Your Web Site Faster · Creating an Online Shopping Cart Mechanism in PHP · Log JavaScript Errors Using an AJAX-driven Web Service
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Configuring Granular Settings for a Database Level Audit · The Perils of a Web 2.0 Transition on Your Business Processes · Facebook Redesigns Site —Again — Nears 400M Mark

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