Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update lib/EvalbotExecuter.pm
Update evalbot to deal with new URL scheme for gists.
  • Loading branch information
thundergnat committed Feb 17, 2013
1 parent c9820f6 commit 3819da9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/EvalbotExecuter.pm
Expand Up @@ -81,10 +81,10 @@ my $max_output_len = 290;

sub run {
my ($program, $executer, $ename) = @_;
if ($program =~ /^https:\/\/gist\.github\.com\/\d+$/) {
if ($program =~ /^https:\/\/gist\.github\.com\/[^\/]+?\/\d+$/) {
my $page = `curl -s $program`;
$page =~ /href="\/raw([^"]+)"/;
if ($1) { $program = decode_utf8 `curl -s https://raw.github.com/gist$1` } else { return 'gist not found' };
$page =~ /<a title="View Raw" href="([^"]+)"/;
if ($1) { $program = decode_utf8 `curl -s https://gist.github.com$1` } else { return 'gist not found' };
} elsif ($program =~ /^https:\/\/github\.com\/([^\/]+\/[^\/]+)\/blob\/([^\/]+\/[^\/].*)$/) {
my ($project, $file) = ($1, $2);
my $page = `curl -s $program`;
Expand Down

0 comments on commit 3819da9

Please sign in to comment.