Created
December 8, 2010 01:31
-
-
Save yaotti/732759 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use LWP::UserAgent; | |
use Getopt::Long; | |
sub listup_changes { | |
my $ua = LWP::UserAgent->new; | |
my $response = $ua->get(qw!http://www.emacswiki.org/emacs/?action=rc;raw=1!); | |
for (split /\n/, $response->decoded_content) { | |
next unless /link: (.+)$/; | |
print $1, "\n"; | |
} | |
} | |
sub open_it { | |
my $url = shift; | |
`open $url`; | |
} | |
GetOptions("init=s" => \my $init, | |
"action=s" => \my $action); | |
if ($init) { | |
if ($init eq 'list') { | |
listup_changes; | |
} | |
}elsif ($action) { | |
my $candidate = shift; | |
if ($action eq 'open') { | |
open_it($candidate); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment