#!/lusr/bin/perl
#----------------------------------------------------------------------------
# Program: "Web to Newsgroup gateway : web2news"
#
# Version: 0.2
#
# Date: Sat May 8 15:47:00 CDT 1999 fixed security holes : Dont use v0.1!!!
# Date: Thu May 7 00:08:21 CDT 1998 added fullheader arg in query. fixed
# '<' and '>' problem (use
).
# Date: Tue May 5 13:25:24 CDT 1998 fixed fullheader option
# Date: Mon May 4 23:08:04 CDT 1998 initial version
#
# Description:
#
# A simple perl script that makes use of 'lynx' to display
# newsgroup content on a web page.
#
# Author: Yoonsuck Choe Copyright (c) 1998
#
# Licensing Terms : Freely distributable for private use only (with this
# header section intact).
# Permission of author required for commercial use.
# Provided as-is. No warranty.
#
# Usage: how to invoke the script in an HTML document
#
# http://host/path/web2newslink?web2newslink=news://news.host/group.name
# \~~~~~~~~~
# optional
# You can use wildcards in the group name -- for example,
#
# comp.os.linux.*
#
# Beware -- if you omit the newsgroup name, and if your news server
# archives thousands of newsgroups, it'll take forever to
# load the newsgroup list.
#
# Source URL:
#
# http://www.cs.utexas.edu/users/yschoe/src/web2news.pl
#
# Requirements:
#
# Lynx Version 2.7.2 (1997) or better
# Perl Version 5.003 or better
# * may work with older versions, but I cannot tell for sure.
#
# TODO:
#
# - detecting error messages returned from lynx
# - restricting access (from outside a certain domain)
#
# References: RFC 1036: Standard for USENET Messages.
# RFC 1738: Uniform Resource Locators (URL)
#
#----------------------------------------------------------------------------
############# Modify these parameters according to your local site setup #####
#
# the lynx browser path
$lynx = "/lusr/bin/lynx";
# how do you invoke this script?
# (on my host, web2news.pl was renamed web2news.cgi)
$cgipath = "http://www.cs.utexas.edu/users/yschoe/cgi-bin/web2news.cgi";
# color preferences (for article)
$titlebarcolor = "\#eeffff"; # light cyan
$headerfieldcolor = "pink";
$headervaluecolor = "\#ffeeee"; # light pink
$textbgcolor = "\#eeeeff"; # light blue
$subjcolor = "red";
$nonsubjcolor = "blue";
# table width (for articles)
$width = 700;
# print full header info?
$fullheader = 0; # display - 0: partial header, 1: full header
#
#################### End of user configurable area ###########################
# some common definitions
$version = "0.1";
$srcurl = "http://www.cs.utexas.edu/users/yschoe/src/web2news.pl";
$trailer = "Script written by Yoonsuck Choe".
"< yschoe\@cs.utexas.edu>\n".
"
Powered by ".
"Lynx".
" and Perl".
" (script source)".
"