News Site (news-site.cgi) is a CGI executable script which checks a POP e-mail account for new mail, verifies the e-mail is from a qualified contributor (or deletes the e-mail), converts the contents of the e-mail object (as understood by REBOL) into a "make object!" expression saved to a file. These "make object!" expressions are set up as news articles, including values for headlines, subheadlines, bylines, titles, body text in paragraphs, reference numbers, file names, and approval status. The script also creates a comments directory for each new article.
When executed, News Site dynamically creates the front page of a news-oriented web site. Currently prints the following as text/html output:
Remember to download the binary appropriate for the operating system your web server is using (not the BeOS binary, unless, of course the web server IS a BeOS-based server.)
You will also want to download the appropriate binary for your BeOS machine (x86 or PowerPC) so that you can execute the script locally and tweak it as you like.
I have converted all available REBOL scripting language documentation into .pdf format available for download from this location. The documentation is current as of 13-May-2000. New documentation is expected soon and will be available from the REBOL Technologies site. You may also purchase REBOL: The Official Guide and REBOL for Dummies from REBOL Press
The style of the news articles and news page banner is dependent upon a cascading style sheet, which is sent by the script as text/html output to the browser. The cascading style sheet is fully customizable provided you retain the same class structures. Your browser must support cascading style sheets in order for the script to display the articles properly by default. In the BeOS, as of 17-September-2000 only the beta version of the Opera browser will display the stylesheet correctly.
You are asked for POP e-mail account information. This is the POP account where you will send news articles for the script to draw from. Replace the "username," "password," and "mail.domain.dom" parts with the username, password, and incoming mail server name for the e-mail address your script will check for new articles. This e-mail account should be used exclusively for News Site.
pop-username: "username" pop-password: "password" pop-mail-server: "mail.domain.dom"
You are asked to configure how many of the most recent headlines news stories you wish to display on your site.
number-of-headlines: 5
You must decide where your news articles will be stored as data. Until new features are added, you will want to make the "unapproved" and "approved" folders the same directory. You must create this directory in your cgi-bin directory.
unapproved-article-folder: "articles/" approved-article-folder: "articles/"
You must decide where your reader comments will be stored as data. Until new features are added, you will want to make the "unapproved" and "approved" folders the same directory. You must create this directory in your cgi-bin directory.
unapproved-comments-folder: "comments/" approved-comments-folder: "comments/"
You must decide where the .rss (Rich Site Summary) XML file will be stored. You must create this directory in your cgi-bin directory.
headlines-directory: "headlines/"
You must tell the script the name of the stylesheet you are going to use. The stylesheet must reside in your cgi-bin directory.
headline-stylesheet: %stylesheet.html
The script will generate the title which appears in the title bar on the browser and will place key words in META tags for search engines. Configure this information next.
page-title: "News Site" meta-keywords: {REBOL Internet Messaging Language scripting Web development}
The top of your news headlines section will display a banner with the name of your publication and copyright information. Configure this, as well.
publication-name: "News Site" copyright-info: {© Ryan C. Christiansen, 2000}
For the .rss (Rich Site Summary) XML file, you must provide some information about the site, including the link to your publication's home page, a description of your publication, and the language the publication is written in.
publication-link: http://www.beosjournal.com publication-description: {Description of site for syndication service} language: "en-us"
Decide how wide in pixels you wish for the page and headlines table to appear in the browser. Until News Site features are extended, you will want to keep these two values the same.
page-width: 480 headlines-width: 480
Change the appropriate fields for each person you wish to be able to post to your web site through e-mail.
The "email-address" variable should reflect the person's "From" address as it appears in an e-mail header. To make sure you know exactly how the e-mail address should be added to the table, have the person send you an e-mail. Oftentimes the "From" address will be different than what you expect.
The "full-name" variable should reflect the person's name as you would have it appear for his or her byline.
The "person-title" variable should reflect the person's title such as "Editor" or "Sports Reporter."
reporters: make object! [ total-reporters: 3 reporter1: make object! [ email-address: rchristiansen@sei-it.com full-name: "Ryan C. Christiansen" person-title: "Editor-in-Chief" ] reporter2: make object! [ email-address: norsepower@uswest.net full-name: "Ryan C. Christiansen" person-title: "Editor-in-Chief" ] reporter3: make object! [ email-address: RChristiansen@pop.isdfa.sei-it.com full-name: "Ryan C. Christiansen" person-title: "Editor-in-Chief" ] ]
Upload the following to your root directory:
index.shtml
Upload the following to your /cgi-bin directory:
/articles folder /comments folder /headlines folder configuration.r displaycomments.cgi functions.r news-site.cgi stylesheet.html
Change permissions (chmod 755) on the news-site.cgi and displaycomments.cgi scripts to make sure everyone can read and execute them. Make sure the /articles, /comments, and /headlines folders have full read, write, and executable permissions set (chmod 777).
There are three main rules you must follow in order for News Site to work correctly.
This is actually an example built with Scoop (the 1.0 version of News Site.) I will post an updated screen shot of a site generate with News Site at a later date.