MHonArc RSS 2.0 rcfile example

View: New views
2 Messages — Rating Filter:   Alert me  

MHonArc RSS 2.0 rcfile example

by Dave Stragand :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello All,

I recently implemented Jeff Breidenbach's RDF feed rcfile that many of
us are using to create news feeds from MHonArc.  I noticed though, that
Internet Explorer 7 (IE7) cannot seem to read this older format as a
valid feed when found via autodiscovery, so I wrote two new rcfiles
which seem to work well -- this one is RSS 2.0 and my previous post is
for ATOM 1.0.  In testing, they both work just fine with IE7.
Admittedly, I'm not much of a coder, so if anyone would like to chime in
and refine these scripts, please feel free.  Good comments and input
help the whole MHonArc user community.

Please note the following items:

  -You will need to change "www.example.org", "YourArchiveName", "Your
Title", etc. in the code to be appropriate for your particular needs.

  -You may need to define a MIME type for ".rss" as "text/xml"

  -All times are scripted in GMT.  This should work fine for most feed
readers, including IE7.

  -Hint: To create this additional index (feed), look at the
documentation for the OTHERINDEXES resource.
(http://www.mhonarc.org/MHonArc/doc/resources/otherindexes.html)

  -It is possible (and IMHO preferable) to continue to generate your
existing RDF file (if applicable) to support any readers who currently
subscribe to that feed. You may call multiple additional indexes/feeds
with the OTHERINDEXES resource.  Alternatively, you could create a
manual RDF file announcing the replacement feed and point users to the
new feed URL.

  -Hint: You will need to run MHonArc via the "MHA-PREVIEW.PL" command
in order to generate the previews/summaries of the messages needed by
this rcfile.

  -Feeds may fail validation at http://feedvalidator.org based on the
output of $X-MSG-PREVIEW$ in the <item>|<description> field. If the
first character of the output is a space or other unacceptable
character, the validator may point this out as an error. In my
experience, this does not affect many (if any) feed readers.

  -To add the "autodiscovery" of the feed by browsers, add the following
code to the <IdxPgBegin> and <TIdxPgBegin> (and optionally, the
<MSGPGBEGIN>) sections of your -MAIN- rcfile, placed within the <HEAD>
code:  <link rel="alternate" type="application/rss+xml" title="RSS 2.0"
href="http://www.example.org/YourArchiveName/maillist.rss"/>

  -Chances are that you are finding this script in a MHonArc Users
archive. Current revisions and bug fixes to this rcfile may be found at
the following permanent URL:
http://www.forwardlook.net/features/rc-rss20.txt 

I hope these files will be as useful to others as the RDF rcfiles by
both Jeff and David have been to me.

Thanks,

-Dave Stragand
http://www.forwardlook.net


RC-RSS20.TXT
* - * - * - * - * - * - * - * - * - * - *

<FieldOrder>

</FieldOrder>

<Sort>

</Sort>

<DayBegin>

</DayBegin>

<DayEnd>

</DayEnd>

<!-- This is a MHonArc rcfile, which is designed to
     generate RSS 2.0 output.

     Written by Dave Stragand, dave(_dot_)stragand(_at_)
     forwardlook(_dot_)net, 2007-04-10, v. 1.0.  Based
     upon the original RDF MHonArc rcfile created by
     Jeff Breidenbach, jeff(_at_)jab(_dot_)org, Aug 26, 1999,
     v. 1.0 and David Gibbs' midrange.com mailing list archives
     RDF RC file example posted at
     http://david.fallingrock.net/2005/07/22/rss-from-mhonarc/

     Current versions of this rcfile may be found at
     http://www.forwardlook.net/features/rc-rss20.txt
                                                         -->


<!-- ------------------------------------ -->
<!-- Section 0: Configuration adjustments -->
<!-- ------------------------------------ -->

<!-- How many messages do we want on the RSS index? -->
<idxsize>
10
</idxsize>

<!-- What file shall we write the RSS 2.0 index to? -->
<idxfname>
maillist.rss
</idxfname>

<!-- ----------------------------- -->
<!-- Section 1: Specify RSS markup -->
<!-- ----------------------------- -->

<ssmarkup>
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
</ssmarkup>

<idxpgbegin>
  <channel>
    <title>Your Title</title>
    <link>http://www.example.org/YourArchiveName</link>
    <description>Description of Your Feed</description>
    <language>en-us</language>
    <pubDate>$GMTDATE(%a, %d %b %Y %H:%M:%S)$ GMT</pubDate>
    <lastBuildDate>$GMTDATE(%a, %d %b %Y %H:%M:%S)$ GMT</lastBuildDate>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <generator>MHonArc RSS 2.0 RCFile</generator>
    <managingEditor>postmaster@... (Postmaster Display
Name)</managingEditor>
    <webMaster>webmaster@... (Webmaster Display
Name)</webMaster>
    <image>
      <title>Your Title</title>
      <url>http://www.example.org/images/image.jpg</url>
      <link>http://www.example.org/YourArchiveName</link>
    </image>
</idxpgbegin>


<litemplate>
  <item>
    <title>$SUBJECTNA$</title>
    <link>http://www.example.org/YourArchiveName/$MSG$</link>
    <description>$X-MSG-PREVIEW$</description>
    <pubDate>$MSGGMTDATE(CUR;%a, %d %b %Y %H:%M:%S)$ GMT</pubDate>
    <guid
isPermaLink="true">http://www.example.org/YourArchiveName/$MSG$</guid>
    <author>$FROMADDR$ ($FROMNAME$)</author>
  </item>
</litemplate>

<idxpgend>
  </channel>
  </rss>
</idxpgend>

<!-- ----------------------------------------------------- -->
<!-- Section 2: Remove any HTML left from default settings -->
<!-- ----------------------------------------------------- -->

<listbegin>
 
</listbegin>

<listend>
 
</listend>

<nodoc>

<nomultipg>
<main>

<!-- --- -->
<!-- End -->
<!-- --- -->


Re: MHonArc RSS 2.0 rcfile example

by Jeff Breidenbach :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 4/14/07, Dave Stragand <dave.stragand@...> wrote:
> I recently implemented Jeff Breidenbach's RDF feed rcfile that many of
> us are using to create news feeds from MHonArc.

Really? People are still using that? I'd switched to RSS quite
some time ago, using the following resource file. However,
yours looks much further refined. Thanks for sharing!

-Jeff

==

<!-- This is a MHonArc rcfile designed to generate RSS output. This
     rcfile is called via OTHERINDEXES from the master rcfile. The RSS
     format is designed for computer to computer communications of data,
     and might be used for providing information produced on one web
     site for display or links on another.  RSS contains content
     information -- and absolutely no information regarding how to
     render that content.  I used the following resources when
     implementing RSS support.

     <A HREF="http://www.slashdot.org/slashdot.xml">
     http://www.slashdot.org/slashdot.xml</A>

     <A  HREF="http://blogs.law.harvard.edu/tech/rss">
     http://blogs.law.harvard.edu/tech/rss</A>

     This rcfile depends on a variable $X-MAILLIST$ which must be
     defined in the MHonArc call (using -definevar) Additionally, this
     rcfile has many hardcoded references to mail-archive.com.

     Jeff Marshall (copied from Jeff Breidenbach's rdf.rc)
     Time-stamp: "Sat 03/03/2004 11:58:00" -->

<!-- ------------------------------------ -->
<!-- Section 0: Configuration adjustments -->
<!-- ------------------------------------ -->

<!-- How many messages do we want on the RSS index? -->
<idxsize>
10
</idxsize>

<!-- What file shall we write the RSS index to? -->
<idxfname>
maillist.xml
</idxfname>

<!-- ----------------------------- -->
<!-- Section 1: Specify RSS markup -->
<!-- ----------------------------- -->

<ssmarkup>
<?xml version="1.0"?><rss version="2.0">

</ssmarkup>

<idxpgbegin>

  <channel>
    <title>$IDXTITLE$ mailing list</title>
    <link>http://www.mail-archive.com/$X-MAILLIST$</link>
    <description>Email archive for $IDXTITLE$.</description>

    <image>
       <title>Mail-Archive.com</title>
       <url>http://www.mail-archive.com/nanologo.gif</url>
       <link>http://www.mail-archive.com/$X-MAILLIST$</link>
    </image>

</idxpgbegin>

<litemplate>
    <item>
      <title>$SUBJECTNA$</title>
      <pubDate>$MSGGMTDATE(CUR;%a, %d %h %Y %H:%M:%S GMT)$</pubDate>
      <link>http://www.mail-archive.com/$X-MAILLIST$/$MSG$</link>
      <guid>http://www.mail-archive.com/$X-MAILLIST$/$MSG$</guid>
   </item>

</litemplate>

<idxpgend>

  </channel>
</rss>

</idxpgend>

<!-- ----------------------------------------------------- -->
<!-- Section 2: Remove any HTML left from default settings -->
<!-- ----------------------------------------------------- -->

<listbegin>

</listbegin>

<listend>

</listend>

<nodoc>

<nomultipg>
<main>

<!-- --- -->
<!-- End -->
<!-- --- -->