#!/usr/bin/perl ### # altblue 1999 ### # o alta varianta infecta de halit headline-uri de aiurea ######### $out = '/home/www/html/headlines'; $bg1 = '#efffff'; $bg2 = '#c6e2ff'; $rama = '#08325C'; $headbgcolor='#8db6df'; $headfgcolor='#08325c'; $fsize= 1; &freshmeat; &linuxtoday; &segfault; &slashdot; exit 0; sub print_table { # my ($file,$alt,$siteurl,$logourl,@news) = @_; my $bg = $bg1; open(OUT,">$file"); print OUT <<" HTML"; \n
HTML foreach $lin (@news) { $bg = ($bg eq $bg2) ? $bg1 : $bg2; local ($url,$title) = split(/ררר/,$lin); print OUT <<" HTML"; HTML } print OUT "
$alt
$title
\n
\n"; close(OUT); } sub freshmeat { $file = "$out/freshmeat.html"; $alt = 'Freshmeat'; $siteurl = '/cgi-bin/out?1'; $newsurl = 'http://freshmeat.net/backend/recentnews.txt'; $logourl='/headlines/logo_freshmeat.gif'; return undef unless &get_data; @news=(); $line=0; while($line < $#data){ push(@news,"$data[$line+2]ררר$data[$line]"); $line +=3; } &print_table; return 1; } sub linuxtoday { $file = "$out/linuxtoday.html"; $alt = 'LinuxToday'; $siteurl = '/cgi-bin/out?2'; $newsurl = 'http://linuxtoday.com/lthead.txt'; $logourl='/headlines/logo_linuxtoday.gif'; return undef unless &get_data; @news=(); $line=5; while($line < $#data){ push(@news,"$data[$line+1]ררר$data[$line]"); $line +=4; } &print_table; return 1; } sub segfault { $file = "$out/segfault.html"; $alt = 'SegFault'; $siteurl = '/cgi-bin/out?3'; $newsurl = 'http://segfault.org/stories.txt'; $logourl='/headlines/logo_segfault.gif'; return undef unless &get_data; while($data[0] ne "%%"){ shift @data; } @news=(); $line=1; while($line < $#data){ push(@news,"$data[$line+1]ררר$data[$line]"); $line +=7; } &print_table; return 1; } sub slashdot { $file = "$out/slashdot.html"; $alt = 'SlashDot'; $siteurl = '/cgi-bin/out?4'; $newsurl = 'http://slashdot.org/ultramode.txt'; $logourl='/headlines/logo_slashdot.gif'; return undef unless &get_data; while($data[0] ne "%%"){ shift @data; } @news=(); $line=1; while($line < $#data){ push(@news,"$data[$line+1]ררר$data[$line]"); $line +=10; } &print_table; return 1; } sub get_data { @data = `/usr/bin/lynx -source -reload $newsurl`; # @data = `/usr/bin/lynx -source $newsurl`; return undef unless @data; return undef if $data[0] =~ //; foreach(@data) { chop; } return 1; }