#!/usr/bin/perl print "Content-type: text/html\n\n"; use DBI; use CGI qw "param"; my $dsn = "DBI:mysql:database=rss;host=localhost"; my $dbh = DBI->connect($dsn, "science", "n3wfuckingp4ssbiatch"); push @pics,"images/pic1.jpg"; push @pics,"images/pic2.jpg"; push @pics,"images/pic3.jpg"; push @pics,"images/pic4.jpg"; push @pics,"images/1pic2.jpg"; push @pics,"images/3pic1.jpg"; push @pics,"images/3pic6.jpg"; my $sth=$dbh->prepare("select categ,count(*) from sources group by categ"); $sth->execute(); print ' Science and technology news site [ SCIENCE.SK ] '; #googlebot linky if($ENV{REMOTE_ADDR}=~/(193.87.16.133|85.216.182.123|217.23.241.50|85.216.135.82|^64.233|^66.102|^66.249|^64.68|^68.142|^66.94|^66.196|^65.54|^207.46|^207.68|^216.239|^65.214|^64.210.196)/oi && $ENV{HTTP_USER_AGENT}=~/.*(Googlebot|Slurp|msnbot|Girafabot|Ask\ Jeeves).*/oi){ print '

Review chicks

'; } print '
[ Science and technology news site ]
SCIENCE.SK About us  |  RSS Sources  |  Search  | Archive  |  Contact  |  Home
 
 
'; $cnt=0; while(my @w=$sth->fetchrow_array()){ $cnt++; print "$w[0] ($w[1])
\n"; if($cnt>3){ last; } } print '



'; $cnt=0; while(my @w=$sth->fetchrow_array()){ $cnt++; print "$w[0] ($w[1])
\n"; if($cnt>3){ last; } } print '
'; $cnt=0; while(my @w=$sth->fetchrow_array()){ $cnt++; print "$w[0] ($w[1])
\n"; if($cnt>3){ last; } } print '

'; $cnt=0; while(my @w=$sth->fetchrow_array()){ $cnt++; print "$w[0] ($w[1])
\n"; if($cnt>3){ last; } } print '
  Latest news
'; my $pth=$dbh->prepare("select feeds.id,categ,title,feeds.cas,sources.nazov,sources.id,max(date_format(feeds.cas,'%Y%m%d')) from feeds left join sources on sources.id=feeds.id_source group by sources.id order by feeds.cas desc limit 0,20"); $pth->execute(); while(my @p=$pth->fetchrow_array()){ $p[2]=~s/[\s\t\r\n ]{1,10}$//goim; $p[2]=~s/^[\s\t\r\n ]{1,10}//goim; $p[4]=~s/[\s\t\r\n ]{1,10}$//goim; $p[4]=~s/^[\s\t\r\n ]{1,10}//goim; my $uurl=$p[4]; my $uurl=$p[4]; $uurl=lc $uurl; $url=$uurl; my $title=$p[2]; $title=lc $title; $url=~s/[^a-zA-Z0-9]{1,100}/ /goim; $url=~s/[\s\t\r\n ]{1,10}$//goim; $url=~s/^[\s\t\r\n ]{1,10}//goim; $url=~s/[\s\n\r\t ]{1,10}/-/goim; $url.="-$p[5]-$p[6]"; $title=ucfirst $title; if(length($title)>30){ $title=substr($title,0,30)." ..."; } print ""; } print '
$title

future in science
Copyright © 2006 NASIETI
 
 
';