Some Science stuff

#!/usr/bin/perl -Tw ############################################################################## # rss2si.pl # # This program writes out a html table or list that can be placed into a # normal html page for displaying RSS feed on the web. The progam is a # modified version of rss2js.pl by Nik Jewell (see below). Modification # done by Kåre Presttun, kare(at)presttun.org 07th March 2004. # # The modification makes the program suitable for being run from SSI. # Typical usage is like this: # # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # ############################################################################## ############################################################################## # rss2js.pl # # # # This program writes out an RSS file to JavaScript for remote display # # # # by Nik Jewell. v0.2 20th May 2002 # # # # Configuration of the visual display characteristics can be carried out # # with the accompanying rssconfig.pl script # # # # Please contact L.N.Jewell@leeds.ac.uk with bugfixes, suggested # # improvments or for assistance # # # # Copyright (C) 2002 PRS-LTSN # # # # This program is free software; you can redistribute it and/or # # modify it under the terms of the GNU General Public License # # as published by the Free Software Foundation; either version 2 # # of the License, or (at your option) any later version. # # # # This program is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program; if not, write to the Free Software # # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA # ############################################################################## # Modules use strict; use CGI; use LWP::Simple; use XML::RSS; # Declare global variables my ($width,$height,$listOn,$listOff); # Create an instance of CGI my $query = new CGI; ##################################################################### # Collect the query data my $remote = $query->param('remote'); my $name = $query->param('name'); my $nameDesc = $query->param('nameDesc'); my $image = $query->param('image'); my $desc = $query->param('desc'); my $num = $query->param('num'); my $box = $query->param('box'); my $copyr = $query->param('copyr'); my $date = $query->param('date'); my $list = $query->param('list'); my $wid = $query->param('wid'); ##################################################################### # Create an instance of XML::RSS my $rss = new XML::RSS; # Fetch the remote file my $xml = get($remote); # Parse the retrieved file $rss->parse($xml); # Create the html table &OUTPUT($rss); ##################################################################### # Main display sub OUTPUT { if (not defined $wid) { $wid = '200' } # Display news items as list items? if (defined($list)) { $listOn = ""; } # Print the header print "Content-type: text/html\n\n"; # Print the opening container table tags print "\n"; # Call the individual display subroutines if (defined($name)) { &NAME; } if ($rss->{'image'}->{'link'} && defined($image)) { ℑ } if ($rss->{'channel'}->{'description'} && defined($nameDesc)) { &NAMEDESC; } if (defined($desc)) { &DESCRIPTION; } else { &TITLE; } if (($rss->{'textinput'}->{'title'}) && defined($box)) { &TEXTINPUT; } if (($rss->{'channel'}->{'pubDate'}) && defined($date)) { &PUBDATE; } if (($rss->{'channel'}->{'copyright'}) && defined($copyr)) { ©RIGHT; } # Print the closing container table tags print "
\n"; } ##################################################################### # Print channel name sub NAME { print "\n"; my $chan="{'channel'}->{'link'}\">$rss->{'channel'}->{'title'}"; &PRINT($chan); print "\n"; } ##################################################################### # Print channel image sub IMAGE { if ($rss->{'image'}->{'width'}) { $width = "$rss->{'image'}->{'width'}"; } if ($rss->{'image'}->{'height'}) { $height = "$rss->{'image'}->{'height'}"; } print "

{'image'}->{'link'}\">{'image'}->{'url'}\" alt=\"$rss->{'image'}->{'title'}\" border=\"0\" width=\"$width\" height=\"$height\">

\n"; } ##################################################################### # Print channel description sub NAMEDESC { print "\n"; my $chandesc="$rss->{'channel'}->{'description'}"; &PRINT($chandesc); print "\n"; } ##################################################################### # Print item title sub TITLE { if (not defined $num) { $num = '0'; } my $s = 1; if ($list eq "y") { my $tableOpen = ""; &PRINT($tableOpen); foreach my $items (@{$rss->{'items'}}) { next unless defined($items->{'title'}) && defined($items->{'link'}) && ($s <= $num); my $titles = "
  • {'link'}\">$items->{'title'}

  • "; &PRINT($titles); $s++ } &PRINT($tableClose); } else { foreach my $items (@{$rss->{'items'}}) { next unless defined($items->{'title'}) && defined($items->{'link'}) && ($s <= $num); my $titles = "{'link'}\">$items->{'title'}"; &PRINT($titles); $s++ } } } ##################################################################### # Print item title and description sub DESCRIPTION { if (not defined $listOn) { $listOn = ''; } if (not defined $listOff) { $listOff = ''; } if (not defined $num) { $num = '0'; } my $s = 1; foreach my $items (@{$rss->{'items'}}) { next unless defined($items->{'title'}) && defined($items->{'link'}) && ($s <= $num); my $title = "$listOn{'link'}\">$items->{'title'}$listOff"; my $desc = "$items->{'description'}"; &PRINT($title); &PRINT($desc); $s++; } } ##################################################################### # Print channel textinput box sub TEXTINPUT { my $input = "
    {'textinput'}->{'link'}\">$rss->{'textinput'}->{'description'}
    {'textinput'}->{'name'}\">
    {'textinput'}->{'title'}\">
    "; &PRINT($input); } ##################################################################### # Print channel publication date sub PUBDATE { my $pub="$rss->{'channel'}->{'pubDate'}"; &PRINT($pub); } ##################################################################### # Print channel copyright sub COPYRIGHT { my $copyR = "$rss->{'channel'}->{'copyright'}"; &PRINT($copyR); } ##################################################################### # Clean up RSS input before printing sub PRINT { # Escape any single quotes (only needed in js output) # $_[0] =~ s/\'/\\'/g; # Get rid of any stray new lines, form feeds or carriage returns in the input $_[0] =~ s/\n//g; $_[0] =~ s/\f//g; $_[0] =~ s/\r//g; # Print the output print "$_[0]\n"; }

    #!/usr/bin/perl -Tw ############################################################################## # rss2si.pl # # This program writes out a html table or list that can be placed into a # normal html page for displaying RSS feed on the web. The progam is a # modified version of rss2js.pl by Nik Jewell (see below). Modification # done by Kåre Presttun, kare(at)presttun.org 07th March 2004. # # The modification makes the program suitable for being run from SSI. # Typical usage is like this: # # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # ############################################################################## ############################################################################## # rss2js.pl # # # # This program writes out an RSS file to JavaScript for remote display # # # # by Nik Jewell. v0.2 20th May 2002 # # # # Configuration of the visual display characteristics can be carried out # # with the accompanying rssconfig.pl script # # # # Please contact L.N.Jewell@leeds.ac.uk with bugfixes, suggested # # improvments or for assistance # # # # Copyright (C) 2002 PRS-LTSN # # # # This program is free software; you can redistribute it and/or # # modify it under the terms of the GNU General Public License # # as published by the Free Software Foundation; either version 2 # # of the License, or (at your option) any later version. # # # # This program is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program; if not, write to the Free Software # # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA # ############################################################################## # Modules use strict; use CGI; use LWP::Simple; use XML::RSS; # Declare global variables my ($width,$height,$listOn,$listOff); # Create an instance of CGI my $query = new CGI; ##################################################################### # Collect the query data my $remote = $query->param('remote'); my $name = $query->param('name'); my $nameDesc = $query->param('nameDesc'); my $image = $query->param('image'); my $desc = $query->param('desc'); my $num = $query->param('num'); my $box = $query->param('box'); my $copyr = $query->param('copyr'); my $date = $query->param('date'); my $list = $query->param('list'); my $wid = $query->param('wid'); ##################################################################### # Create an instance of XML::RSS my $rss = new XML::RSS; # Fetch the remote file my $xml = get($remote); # Parse the retrieved file $rss->parse($xml); # Create the html table &OUTPUT($rss); ##################################################################### # Main display sub OUTPUT { if (not defined $wid) { $wid = '200' } # Display news items as list items? if (defined($list)) { $listOn = "

    "; } # Print the header print "Content-type: text/html\n\n"; # Print the opening container table tags print "\n"; # Call the individual display subroutines if (defined($name)) { &NAME; } if ($rss->{'image'}->{'link'} && defined($image)) { &IMAGE; } if ($rss->{'channel'}->{'description'} && defined($nameDesc)) { &NAMEDESC; } if (defined($desc)) { &DESCRIPTION; } else { &TITLE; } if (($rss->{'textinput'}->{'title'}) && defined($box)) { &TEXTINPUT; } if (($rss->{'channel'}->{'pubDate'}) && defined($date)) { &PUBDATE; } if (($rss->{'channel'}->{'copyright'}) && defined($copyr)) { ©RIGHT; } # Print the closing container table tags print "
    \n"; } ##################################################################### # Print channel name sub NAME { print "\n"; my $chan="{'channel'}->{'link'}\">$rss->{'channel'}->{'title'}"; &PRINT($chan); print "\n"; } ##################################################################### # Print channel image sub IMAGE { if ($rss->{'image'}->{'width'}) { $width = "$rss->{'image'}->{'width'}"; } if ($rss->{'image'}->{'height'}) { $height = "$rss->{'image'}->{'height'}"; } print "

    {'image'}->{'link'}\">{'image'}->{'url'}\" alt=\"$rss->{'image'}->{'title'}\" border=\"0\" width=\"$width\" height=\"$height\">

    \n"; } ##################################################################### # Print channel description sub NAMEDESC { print "\n"; my $chandesc="$rss->{'channel'}->{'description'}"; &PRINT($chandesc); print "\n"; } ##################################################################### # Print item title sub TITLE { if (not defined $num) { $num = '0'; } my $s = 1; if ($list eq "y") { my $tableOpen = ""; &PRINT($tableOpen); foreach my $items (@{$rss->{'items'}}) { next unless defined($items->{'title'}) && defined($items->{'link'}) && ($s <= $num); my $titles = "
  • {'link'}\">$items->{'title'}

  • "; &PRINT($titles); $s++ } &PRINT($tableClose); } else { foreach my $items (@{$rss->{'items'}}) { next unless defined($items->{'title'}) && defined($items->{'link'}) && ($s <= $num); my $titles = "{'link'}\">$items->{'title'}"; &PRINT($titles); $s++ } } } ##################################################################### # Print item title and description sub DESCRIPTION { if (not defined $listOn) { $listOn = ''; } if (not defined $listOff) { $listOff = ''; } if (not defined $num) { $num = '0'; } my $s = 1; foreach my $items (@{$rss->{'items'}}) { next unless defined($items->{'title'}) && defined($items->{'link'}) && ($s <= $num); my $title = "$listOn{'link'}\">$items->{'title'}$listOff"; my $desc = "$items->{'description'}"; &PRINT($title); &PRINT($desc); $s++; } } ##################################################################### # Print channel textinput box sub TEXTINPUT { my $input = "
    {'textinput'}->{'link'}\">$rss->{'textinput'}->{'description'}
    {'textinput'}->{'name'}\">
    {'textinput'}->{'title'}\">
    "; &PRINT($input); } ##################################################################### # Print channel publication date sub PUBDATE { my $pub="$rss->{'channel'}->{'pubDate'}"; &PRINT($pub); } ##################################################################### # Print channel copyright sub COPYRIGHT { my $copyR = "$rss->{'channel'}->{'copyright'}"; &PRINT($copyR); } ##################################################################### # Clean up RSS input before printing sub PRINT { # Escape any single quotes (only needed in js output) # $_[0] =~ s/\'/\\'/g; # Get rid of any stray new lines, form feeds or carriage returns in the input $_[0] =~ s/\n//g; $_[0] =~ s/\f//g; $_[0] =~ s/\r//g; # Print the output print "$_[0]\n"; }

    Distributed Computing

    Many problems require huge amounts of computer power to be solved. Your computer is doing nothing most of the time. You can help science by giving away your idle computer power.

    Claude Shannon

    Claude Shannon was one of the greatest scientists of the 20th century.

    Immanuel Velikovsky

    Many scientists and historians have criticised Velikovsky's works over the years, unfortunately, many have done so inaccurately resulting in the public's misconception that Velikovsky was "completely proved wrong". I can only recommend you to read one of his books, like Worlds in Collision, and make up your own mind.

    Strange Stuff

    Many things seems weird or strange. Many things are still not understood. Especially many ancient mysteries are still not solved. Did anything special happen 10,500 BC?

    Be skeptical about it! Read here

    Great Sites

    Numbers

    Library

    Magazines