jablonka.czprosek.czf

getonlineclouds

Subversion Repositories:
[/] [getonlineclouds.pl] - Blame information for rev 2

 

Line No. Rev Author Line
11simandl#!/usr/bin/perl
2#
3# Petr Simandl, www.simandl.cz
4#
5 
62simandl$date = `date`;
71simandlprint "Content-type: text/html\n\n";
8 
9print "<HTML><HEAD><META HTTP-EQUIV=Pragma CONTENT=no-cache></HEAD><BODY>\n";
10 
11print "Porovnani obsahu wiki <a href=\"http://czfree.net/wiki/Registrovane_cloudy\">Registrovane_cloudy</a>
122simandls aktualnima <a href=\"/cgi-bin/route.cgi\">routama</a> : $date";
131simandl 
14print "<pre>";
15 
16@gl_cloudy=`wget -q -O - http://czfree.net/wiki/Registrovane_cloudy`;
17@gl_routy=`ip ro ls | grep ^10 `;
18 
192simandl$gl_pocetonline = 0;
20$gl_pocetzastupcu = 0;
21$gl_pocethlasu = 0;
22$gl_pocetofflinehlasu = 0;
231simandl 
24foreach $gl_line (@gl_cloudy)
25{
26 if ($gl_line =~ /^\<td\> AS6/)
27 {#print "$gl_pole[4] $gl_pole[5]\n";
28 $gl_line =~ s/<td> //;
29 $gl_line =~ s/<\/td><td>/\t/g;
30 
31 @gl_pole=split("\t",$gl_line);
32 $gl_as = $gl_pole[0];
33 $gl_as =~ s/ //g;
34 $gl_rozsah = $gl_pole[1];
35 $gl_rozsah =~ s/ //g;
36 @gl_rozsah=split("a",$gl_rozsah);
37 
38 $gl_zastupce = $gl_pole[2];
392simandl $gl_zastupce =~ s/ //g;
401simandl $gl_udaje = $gl_pole[3];
41 $gl_online = $gl_pole[4];
422simandl $gl_online =~ s/\n//g;
43 $gl_online =~ s/ //g;
44 $gl_hlas = $gl_pole[5];
45 $gl_hlas =~ s/\n//g;
46 $gl_hlas =~ s/ //g;
471simandl $gl_pritomno = 0;
48 $gl_podobne = "";
49 
502simandl if ("$gl_hlas" eq "ano") {$gl_pocethlasu += 1};
51 if ("$gl_online" eq "ano") {$gl_pocetonline += 1};
52 if ("$gl_zastupce" ne "ne") {$gl_pocetzastupcu += 1};
53 
541simandl print "<a href=\"http://ripe.czfree.net/index.php?action=object.search&paramvalue=$gl_rozsah\">$gl_as</a> ma mit @gl_rozsah a nalezeno: ";
55 
56 foreach $gl_routa (@gl_rozsah)
57 {
58 foreach $gl_iprouta (@gl_routy)
59 {
60 @gl_linka=split(" ",$gl_iprouta);
61 if ("$gl_linka[0]" eq "$gl_routa")
62 {
63 $gl_pritomno += 1;
64 print "$gl_routa ";
65 } else {
66 @gl_ipnum=split("\\.",$gl_linka[0]);
67 @gl_ronum=split("\\.",$gl_routa);
68 if ("$gl_ipnum[1]" eq "$gl_ronum[1]")
69 {
70 $gl_podobne .= "<a href=\"http://ripe.czfree.net/index.php?action=object.search&paramvalue=$gl_linka[0]\">$gl_linka[0]</a> ";
71 }
72 }
73 }
74 }
75 if ($gl_pritomno == 0)
762simandl { print "nic\t";
771simandl }
78 if ($gl_podobne)
79 {
80 print "\tpodobne routy: $gl_podobne ";
81 }
822simandl if (("$gl_hlas" eq "ano") && ($gl_pritomno == 0) && !($gl_podobne))
83 {
84 print " <blink>!</blink>$gl_zastupce<blink>!</blink> $gl_online $gl_hlas \n";
85 $gl_pocetofflinehlasu += 1;
86 } else {
87 print " $gl_zastupce $gl_online $gl_hlas \n";
881simandl }
892simandl }
901simandl}
91 
922simandlprint "Shrnuti wiki:\n";
93print "Pocet zastupcu : $gl_pocetzastupcu\n";
94print "Pocet online : $gl_pocetonline\n";
95print "Pocet zastupcu s hlasovacim pravem : $gl_pocethlasu\n";
96print "Pocet zastupcu kteri prave ted maji sit offline : $gl_pocetofflinehlasu\n";
971simandlprint "</pre></body></html>";

Powered by WebSVN 2.2.1