|
@@ -16,12 +16,74 @@ my $date_jffdn = ""; # date de la rentrée dans la fédé
|
|
|
my $contact = ""; # email de contact
|
|
|
my $description = ""; # description de l'asso
|
|
|
|
|
|
-my $wrk_dir = "wrk-dir";
|
|
|
+# le repectoire des données du bot aka autoconf
|
|
|
+my $bot_dir = `pwd`; chomp $bot_dir ; $bot_dir .= "/";
|
|
|
+my $wrk_dir = "wrk-dir/";
|
|
|
+my $dir = $bot_dir.$wrk_dir;
|
|
|
+
|
|
|
+my %regex = (
|
|
|
+ # Apinnet
|
|
|
+ "apinnet" => "\b(ap[in]|Poitou|Charente|Rochelle|(Deux[- ])?S[èe]vres?|Vienne|Angoul[eêè]me|Niort|Poitiers)",
|
|
|
+ # Aquilenet
|
|
|
+ "aquilenet" => "\b(aq(ui|n)|Bord(o|e?au)|Landes|Gironde)",
|
|
|
+ # ARN
|
|
|
+ "arn" => "\b(a(lsace|rn)|Stras|Colma)",
|
|
|
+ # Auvernet
|
|
|
+ "auvernet" => "\b(Auver|Puy[- ](de[- ])D[oô]me|avn)",
|
|
|
+ # Cafai
|
|
|
+ "cafai" => "\b(cafai|champagne|ardenn?e)",
|
|
|
+ # faimaison
|
|
|
+ "faimaison" => "\b(fma|fail?m|Nantes|Loire[- ]Atlantique)",
|
|
|
+ # FDN
|
|
|
+ "fdn" => "\bf(rench|dn)",
|
|
|
+ # franciliens.net
|
|
|
+ "franciliens" => "\b(f(ranc|cn)|idf|Paris)",
|
|
|
+ # grifon
|
|
|
+ "grifon" => "\b(grif|rennes|[îi]l?le[- ](et[- ])?vilaine)",
|
|
|
+ # ilico
|
|
|
+ "ilico" => "\b(ilc|ill?[iy][ck])|(Corr?[éêèe][sz])",
|
|
|
+ # illyse
|
|
|
+ "illyse" => "\b(ill?y|ill?i[sz]|lyon|rh[ôo]ne|loire|((st|saint)[- ]etienn?e))",
|
|
|
+ # iloth
|
|
|
+ "iloth" => "\b(ilo|mont?pel|h[ée]rault)",
|
|
|
+ # ldn
|
|
|
+ "ldn" => "\b(l(or|dn)|Nancy|Metz|Moselle|Meuse|Meurthe|Vosges)",
|
|
|
+ # ndn
|
|
|
+ "ndn" => "\b(n(ice|dn)|Antibes|Cannes|Valbonne|Alpes[- ]Maritimes)",
|
|
|
+ # netopi
|
|
|
+ "netopi" => "\b(netopi|Seine[- ](et[- ])?Marne)",
|
|
|
+ # pclight
|
|
|
+ "pclight" => "\b(yonne|beon|cheny|pc[- ]?l)",
|
|
|
+ # rézine
|
|
|
+ "rezine" => "\b(r[eé]z|Isère|Grenoble)",
|
|
|
+ # rhizome
|
|
|
+ "rhizome" => "\b(rh?[iy][sz]om|Oise|Compi[eéêè]gne)",
|
|
|
+ # sames
|
|
|
+ "same" => "\bsam|(Pyrénées[- ]Atlantiques)",
|
|
|
+ # sdn
|
|
|
+ "sdn" => "\b(s(all|dn)|Savoie|Haute[- ]Savoie)",
|
|
|
+ # teleragno
|
|
|
+ "teleragno" => "\b(mars|telerag|telegrano)",
|
|
|
+ # tetaneutral
|
|
|
+ "tetaneutral" => "\b(t(eta|tn|nn)|Toulouse|Comminges|(Haute[- ]Garon?ne))",
|
|
|
+ # ail-network
|
|
|
+ "ail" => "\bail/",
|
|
|
+ # chaul'hertz
|
|
|
+ "chaul" => "\b(c(haul|hz)|hertz|tarn|autan)",
|
|
|
+ # igwan
|
|
|
+ "igwan" => "\b(ig[wn]|sbg|saint[- ]barth)",
|
|
|
+ # neutrinet
|
|
|
+ "neutrinet" => "\b(neutri|n[tre]n|belgique)",
|
|
|
+ # et le meilleur pour la fin
|
|
|
+ "ffdn" => "\bf(ede|fdn|rance|édé)",
|
|
|
+ );
|
|
|
+
|
|
|
+
|
|
|
|
|
|
# Lis le fichier contenant les infos d'un FAI
|
|
|
sub info {
|
|
|
my $fai = shift @_;
|
|
|
- my $filename = "/home/canouan/bot-irc/". $wrk_dir."/". $fai.".info";
|
|
|
+ my $filename = $dir.$fai.".info";
|
|
|
if (-e $filename)
|
|
|
{
|
|
|
my $fh;
|
|
@@ -41,47 +103,7 @@ sub info {
|
|
|
# Lis le fichier contenant les nombres adh/abo d'un FAI
|
|
|
sub adh {
|
|
|
my $fai = shift @_;
|
|
|
- my $filename = "/home/canouan/bot-irc/". $wrk_dir."/". $fai.".adh";
|
|
|
- my $fh;
|
|
|
- open ($fh, '<', $filename) or die "Impossible d'ouvrir le fichier $filename en lecture";
|
|
|
- while (my $line = <$fh>)
|
|
|
- {
|
|
|
- return $line;
|
|
|
- }
|
|
|
- close $fh;
|
|
|
-}
|
|
|
-
|
|
|
-# lis le fichier avec les infos pour la réunion de suivi
|
|
|
-sub suivi {
|
|
|
- my $filename = "/home/canouan/bot-irc/". $wrk_dir."/suivi";
|
|
|
- if (-e $filename)
|
|
|
- {
|
|
|
- my $fh;
|
|
|
- open ($fh, '<', $filename) or die "Impossible d'ouvrir le fichier $filename en lecture";
|
|
|
- while (my $line = <$fh>)
|
|
|
- {
|
|
|
- return $line;
|
|
|
- }
|
|
|
- close $fh;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-# lis le fichier avec les infos pour la réunion de suivi
|
|
|
-sub vote {
|
|
|
- my $filename = "/home/canouan/bot-irc/". $wrk_dir."/vote";
|
|
|
- my $fh;
|
|
|
- open ($fh, '<', $filename) or die "Impossible d'ouvrir le fichier $filename en lecture";
|
|
|
- while (my $line = <$fh>)
|
|
|
- {
|
|
|
- return $line;
|
|
|
- }
|
|
|
- close $fh;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-sub adh_abo_ffdn {
|
|
|
- my $filename = "/home/canouan/bot-irc/". $wrk_dir."/ffdn.adh";
|
|
|
+ my $filename = $dir.$fai.".adh";
|
|
|
my $fh;
|
|
|
open ($fh, '<', $filename) or die "Impossible d'ouvrir le fichier $filename en lecture";
|
|
|
while (my $line = <$fh>)
|
|
@@ -93,3 +115,6 @@ sub adh_abo_ffdn {
|
|
|
|
|
|
print info("ilicao");
|
|
|
print info("ilico");
|
|
|
+print info "sames";
|
|
|
+print info "fcn";
|
|
|
+print info "illyse";
|