---------------
4/12/2015 7:09:16 AM
Checking http://builds.kolmafia.us/ for the latest version of KoLMafia...
KoLmafia-15739.jar is the latest version
Attempting to download http://builds.kolmafia.us/KoLmafia-15739.jar...
Successfully downloaded http://builds.kolmafia.us/KoLmafia-15739.jar
Copying KoLmafia-15739.jar to KoLmafia-latest.jar
Deleting old version KoLmafia-15737.jar
Running KoLmafia-latest.jar...
---------------
---------------
4/20/2015 7:35:08 AM
Checking http://builds.kolmafia.us/ for the latest version of KoLMafia...
Running KoLmafia-latest.jar...
---------------
#!/usr/bin/perl
use strict;
use warnings;
use WWW::Mechanize;
my $url = "http://builds.kolmafia.us/";
my $mech = WWW::Mechanize->new();
$mech->get( $url );
my @links = sort( $mech->content =~ m/http:\/\/builds.kolmafia.us\/KoLmafia-[0-9]+.jar/g);
my $downloadurl = pop @links;
print $downloadurl;
my $downloadlink = WWW::Mechanize->new();
$downloadlink->get ($downloadurl) or die "unable to find $downloadurl for download";
$downloadlink->save_content("kol.jar");
chmod(0755, "kol.jar") or die "Couldn't chmod kol.jar: $!";
Looking at the code, updating this Perl script should be easy, assuming you know Perl, which I don'tAny chance of getting this updated to use the new automatic build site, or do I need to finally move to a different tool?
Looking at the code, updating this Perl script should be easy, assuming you know Perl, which I don't
#!/usr/bin/perl
use strict;
use warnings;
use WWW::Mechanize;
my $url = "http://ci.kolmafia.us/job/Kolmafia/lastSuccessfulBuild/artifact/dist/";
my $mech = WWW::Mechanize->new();
$mech->get( $url );
my @links = sort( $mech->content =~ m/KoLmafia-[0-9]+.jar/g);
my $downloadurl = "http://ci.kolmafia.us/job/Kolmafia/lastSuccessfulBuild/artifact/dist/" . pop @links;
print $downloadurl;
my $downloadlink = WWW::Mechanize->new();
$downloadlink->get ($downloadurl) or die "unable to find $downloadurl for download";
$downloadlink->save_content("kol.jar");
chmod(0755, "kol.jar") or die "Couldn't chmod kol.jar: $!";
sub by_number {
my ( $anum ) = $a =~ /(\d+)/;
my ( $bnum ) = $b =~ /(\d+)/;
( $anum || 0 ) <=> ( $bnum || 0 );
}
my @links = sort by_number $mech->content =~ m/KoLmafia-[0-9]+.jar/g;
my @links = sort( $mech->content =~ m/KoLmafia-[0-9]+.jar/g);
my $downloadurl = "http://ci.kolmafia.us/job/Kolmafia/lastSuccessfulBuild/artifact/dist/" . pop @links;
$mech->content =~ m/(KoLmafia-[0-9]+.jar)/
my $downloadurl = "http://ci.kolmafia.us/job/Kolmafia/lastSuccessfulBuild/artifact/dist/$1";
Anyone have access to the C# code that was posted in the OP?