X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/04fed8e4657d28df3ca947ea34c2a5d8f9ccc02f..61d7dd11d4a450a64f2817ee4db0ec7fa5880b42:/bin/old/cr2html?ds=inline diff --git a/bin/old/cr2html b/bin/old/cr2html new file mode 100755 index 0000000..58f584a --- /dev/null +++ b/bin/old/cr2html @@ -0,0 +1,55 @@ +#! /usr/bin/perl +# Does something to Ogame combat reports... Don't really care anymore + +use strict; + +my $input; + +open (CREPORT, $input = "index.php.html") || + die ("Could not open file: $!"); +# print ("File opened\n"); + +open (CROUT, ">tmp"); + +#local $/; + +my $atacker; +my $defender; + +my $day; +my $month; + + +while () { +# Getting atacker and defender names + if (/>(.*)\ vs.\ (.*)/[x:xxx:xx]<\/a>/; + + if (/[ \t\n]*Weapons.*Armour.*<\/tr>/m) { + print STDERR ("yep\n"); + } + + print CROUT; +} + +close(CREPORT); close(CROUT); + +my $output = "$month.$day $atacker -vs- $defender.html"; + +rename ("tmp", "$output") || + die ("Could not create file $output"); +unlink ($input); + +print ("$input renamed as $output\n");