Buildfile: /home/kolmafia/svn/build.xml
clean:
[symlink] Removing symlink: dist/KoLmafia-15.1/Applications
init:
update:
[exec] U /home/kolmafia/svn/src/net/sourceforge/kolmafia/session/ChoiceManager.java
[exec] U /home/kolmafia/svn/src/net/sourceforge/kolmafia/RequestEditorKit.java
[exec] U /home/kolmafia/svn/src/net/sourceforge/kolmafia/request/GenericRequest.java
[exec] Updated to revision 10634.
svn-version:
gitsvn-version:
version:
[echo] Current revision: 10634M
daily:
init:
jikeshome:
javahome:
[exec] java version "1.6.0_26"
[exec] Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
[exec] Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)
compile:
[echo] Using modern compiler
[javac] Compiling 70 source files to /home/kolmafia/svn/build
[copy] Copying 10 files to /home/kolmafia/svn/build
[copy] Copied 3 empty directories to 1 empty directory under /home/kolmafia/svn/build
svn-version:
gitsvn-version:
version:
[echo] Current revision: 10634M
[javac] Compiling 684 source files to /home/kolmafia/svn/build
svn-version:
gitsvn-version:
unversion:
[copy] Copying 137 files to /home/kolmafia/svn/build
[jar] Building jar: /home/kolmafia/svn/dist/KoLmafia-10634M.jar
BUILD SUCCESSFUL
Total time: 12 seconds
This is interesting! I didn't realize a KoLmafia updater was even possible to do with Perl. Thanks for sharing!I have made a perl script to download the latest hourly build for me. This script was written for unix type system but should work on windows ( the chmod line is not needed on windows) this script needs the www:Mechanize package installed.
(code removed to save space)
Perl can do pretty much anything. How easily it can do those things and how readable the resulting code would be is a different matterI didn't realize a KoLmafia updater was even possible to do with Perl.
one of my die statments caused some issues here is the revised code
#!/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 = $mech->links();
foreach my $link (@links) {
if ( $link->url =~ m/.*.jar$/ ) {
my $downloadurl = $link->url();
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: $!";
last;
}
}
Can't locate WWW/Mechanize.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at update.pl line 5.
BEGIN failed--compilation aborted at update.pl line 5.
this script needs the www:Mechanize package installed.
aptitude install libwww-mechanize-perl
Tried this on my ubuntu PC
@zeroToNine - That works on a debian based system such as ubuntu
List<string> split = new List<string>(line.Split("\"\"".ToCharArray())).FindAll(s => s.Contains("http://builds.kolmafia.us/KoLmafia-"));