Add NrrRgn
git-svn-id: http://photonzero.com/dotfiles/trunk@120 23f722f6-122a-0410-8cef-c75bd312dd78
This commit is contained in:
parent
523fde6acd
commit
187ef21130
8 changed files with 1957 additions and 0 deletions
58
.vim/bundle/NrrwRgn/post.pl
Executable file
58
.vim/bundle/NrrwRgn/post.pl
Executable file
|
|
@ -0,0 +1,58 @@
|
|||
#!/usr/bin/perl
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use WWW::Mechanize;
|
||||
|
||||
sub GetPassword() {
|
||||
my $i=0;
|
||||
my @pass;
|
||||
my $passfile="./vim_passfile"; # line1: username, line2: password
|
||||
open(PASS, '<',$passfile) or die "Can't open passwordfile: $passfile\n";
|
||||
while(<PASS>){
|
||||
chomp;
|
||||
$pass[$i++] = $_;
|
||||
}
|
||||
close(PASS);
|
||||
return @pass;
|
||||
}
|
||||
|
||||
my $sid=3075;
|
||||
my $file;
|
||||
my @files=glob('*.vmb');
|
||||
#my $scriptversion=shift @ARGV;
|
||||
my $scriptversion = 0;
|
||||
my $versioncomment=shift @ARGV;
|
||||
unless ($versioncomment){
|
||||
print "Please enter comment!\n";
|
||||
exit;
|
||||
}
|
||||
$versioncomment.="\n(automatically uploaded)";
|
||||
|
||||
|
||||
my @userpasswordpair = GetPassword();
|
||||
for (@files) {
|
||||
my $f = $_ if [ -f $_ ] && $_ =~ /\w+-[^.]+\.(\d+)\.vmb/;
|
||||
if ($1 > $scriptversion) {
|
||||
$scriptversion=$1;
|
||||
$file = $f;
|
||||
}
|
||||
}
|
||||
|
||||
my $mech=WWW::Mechanize->new(autocheck => 1);
|
||||
$mech->get("http://www.vim.org/login.php");
|
||||
$mech->submit_form(
|
||||
form_name => "login",
|
||||
with_fields => {
|
||||
userName => $userpasswordpair[0],
|
||||
password => $userpasswordpair[1],
|
||||
},
|
||||
);
|
||||
$mech->get("http://www.vim.org/scripts/script.php?script_id=$sid");
|
||||
$mech->follow_link(text => 'upload new version');
|
||||
$mech->form_name("script");
|
||||
$mech->field(script_file => $file);
|
||||
$mech->field(vim_version => 7.3);
|
||||
$mech->field(script_version => $scriptversion);
|
||||
$mech->field(version_comment => $versioncomment);
|
||||
$mech->click_button(value => "upload");
|
||||
Loading…
Add table
Add a link
Reference in a new issue