Finally! News archiving (and publishing) system

Anderson Lizardo andersonlizardo at
Mon Sep 1 06:47:48 PDT 2003


I'm very proud to announce the final "news archiving [and publishing] 
system" implementation, which fulfills the functions explained at

The system "installation" is simple:
1) Apply the website-20030831-remove_news.patch patch to the current 
CVS. It removes the news entries from news-top.html files and the 
generalnews.txt file.
2) Unpack install_archive.tar.gz into the CVS. It will create the 
following files:


"" is the actual archiving script. "" is a 
bash script which demonstrates the usage of (it only 
creates the general and LFS archives, and the lfs/news.html file). The 
news-2003.txt files are the news databases, in MIME format (read below 
why I have decided to use MIME). news-template.txt is a template of the 
MIME news database. archive-*.html are sample templates for the archive 


While writing the script which implements the format described in,

I noted that it (the format) was very similar to a MIME message. So 
I've decided to use the excellent and rock-solid MIME-Tools Perl 
module, and dropped the idea of writing a complete (and untested) 
parsing system.

The basic differences between the old format and the MIME one are:
- The parts (in our case, news items) are separated from each other by a 
content boundary. I used "NEWS_ITEM_BOUNDARY" as boundary. You can 
change this boundary, but you have to garantee the uniqueness of it 
inside the database (in other words, "--NEWS_ITEM_BOUNDARY" should not 
occur in the begin of a line in the news contents).
- There is no "content:" field. The news content is the body of each 
MIME part.
- It has a "global header", where you should set the "section:" field to 
the right value: general, lfs, blfs, hints, alfs, patches. This field 
determines which directory under news/ the news should be archived and 
the URL to resolve relative links.

The restrictions of the MIME format are:
- The minimal structure of the database should be:

[no space]Content-Type: multipart/mixed;
[no space]MIME-Version: 1.0
[no space]Section: section_name
[empty line]
[no space]Title: News Title
[no space]Author: Author Name
[no space]Date: YYYY/MM/DD
[no space]Id: news_item_id
[empty line]
        <p>The news item content goes here.</p>
[empty line]
[no space]Title: Other News
[no space]Author: Other Author
[no space]Date: YYYY/MM/DD
[no space]Id: other_news_item_id
[empty line]
        <p>The news item content goes here.</p>
[empty line]
[no space]--NEWS_ITEM_BOUNDARY--

- The lines labeled [empty line] are (of course) empty lines, and _must_ 
- The lines labeled [no space] cannot have blank spaces at the beginning 
of the line.
- each part boundary starts with "--", and the last one ends with "--".
- For other restrictions (not important to us), read the MIME RFCs.

And remember, the most recent news are on top, right below the "global 

Any suggestions or doubts, just say/ask ;-)
Anderson Lizardo

Desafio AntiZona: participe do jogo de perguntas e respostas que vai
dar um Renault Clio, computadores, câmeras digitais, videogames e muito
-------------- next part --------------
A non-text attachment was scrubbed...
Name: install_archive.tar.gz
Type: application/x-tar
Size: 19139 bytes
Desc: install_archive.tar.gz
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: website-20030831-remove_news.patch.gz
Type: application/x-gzip
Size: 13484 bytes
Desc: website-20030831-remove_news.patch.gz
URL: <>

More information about the website mailing list