jablonka.czprosek.czf

getonlineclouds

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

 

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 
144simandlprint "<pre>\n";
15print "<b>AS Grafy s historii rozsahy z wiki rozsahy online Zastupce Online Hlasuje</b>\n";
161simandl 
17@gl_cloudy=`wget -q -O - http://czfree.net/wiki/Registrovane_cloudy`;
18@gl_routy=`ip ro ls | grep ^10 `;
19 
202simandl$gl_pocetonline = 0;
21$gl_pocetzastupcu = 0;
22$gl_pocethlasu = 0;
23$gl_pocetofflinehlasu = 0;
241simandl 
25foreach $gl_line (@gl_cloudy)
26{
27 if ($gl_line =~ /^\<td\> AS6/)
28 {#print "$gl_pole[4] $gl_pole[5]\n";
29 $gl_line =~ s/<td> //;
30 $gl_line =~ s/<\/td><td>/\t/g;
31 
32 @gl_pole=split("\t",$gl_line);
33 $gl_as = $gl_pole[0];
34 $gl_as =~ s/ //g;
35 $gl_rozsah = $gl_pole[1];
36 $gl_rozsah =~ s/ //g;
37 @gl_rozsah=split("a",$gl_rozsah);
38 
39 $gl_zastupce = $gl_pole[2];
402simandl $gl_zastupce =~ s/ //g;
411simandl $gl_udaje = $gl_pole[3];
42 $gl_online = $gl_pole[4];
432simandl $gl_online =~ s/\n//g;
44 $gl_online =~ s/ //g;
45 $gl_hlas = $gl_pole[5];
46 $gl_hlas =~ s/\n//g;
47 $gl_hlas =~ s/ //g;
481simandl $gl_pritomno = 0;
49 $gl_podobne = "";
503simandl $gl_ping = $gl_rozsah[0];
51 $gl_ping =~ s/\//xx/g;
52 $gl_bgp = $gl_as;
53 $gl_bgp =~ s/AS//g;
541simandl 
552simandl if ("$gl_hlas" eq "ano") {$gl_pocethlasu += 1};
56 if ("$gl_online" eq "ano") {$gl_pocetonline += 1};
57 if ("$gl_zastupce" ne "ne") {$gl_pocetzastupcu += 1};
58 
593simandl print "<a href=\"http://ripe.czfree.net/index.php?action=object.search&paramvalue=$gl_rozsah\">$gl_as</a> (historie ";
60 print "<a href=\"http://sitelka.jablonka.cz/hotsanic/bgp/$gl_bgp.html\">bgp</a> ";
61 print "<a href=\"http://sitelka.jablonka.cz/hotsanic/ping/$gl_ping.html\">pingu</a>) ma mit $gl_rozsah a nalezeno: ";
621simandl 
63 foreach $gl_routa (@gl_rozsah)
64 {
65 foreach $gl_iprouta (@gl_routy)
66 {
67 @gl_linka=split(" ",$gl_iprouta);
68 if ("$gl_linka[0]" eq "$gl_routa")
69 {
70 $gl_pritomno += 1;
71 print "$gl_routa ";
72 } else {
73 @gl_ipnum=split("\\.",$gl_linka[0]);
74 @gl_ronum=split("\\.",$gl_routa);
75 if ("$gl_ipnum[1]" eq "$gl_ronum[1]")
76 {
77 $gl_podobne .= "<a href=\"http://ripe.czfree.net/index.php?action=object.search&paramvalue=$gl_linka[0]\">$gl_linka[0]</a> ";
78 }
79 }
80 }
81 }
82 if ($gl_pritomno == 0)
832simandl { print "nic\t";
841simandl }
85 if ($gl_podobne)
86 {
87 print "\tpodobne routy: $gl_podobne ";
88 }
892simandl if (("$gl_hlas" eq "ano") && ($gl_pritomno == 0) && !($gl_podobne))
90 {
91 print " <blink>!</blink>$gl_zastupce<blink>!</blink> $gl_online $gl_hlas \n";
92 $gl_pocetofflinehlasu += 1;
93 } else {
94 print " $gl_zastupce $gl_online $gl_hlas \n";
951simandl }
962simandl }
971simandl}
98 
992simandlprint "Shrnuti wiki:\n";
100print "Pocet zastupcu : $gl_pocetzastupcu\n";
101print "Pocet online : $gl_pocetonline\n";
102print "Pocet zastupcu s hlasovacim pravem : $gl_pocethlasu\n";
103print "Pocet zastupcu kteri prave ted maji sit offline : $gl_pocetofflinehlasu\n";
1041simandlprint "</pre></body></html>";

Powered by WebSVN 2.2.1