Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Unbusticate evalbot execution of gists
Chase the ever changing URL extraction scheme to access the raw gist.
  • Loading branch information
thundergnat committed Feb 26, 2015
1 parent e3a593d commit e683ad0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/EvalbotExecuter.pm
Expand Up @@ -83,8 +83,8 @@ sub run {
my ($program, $executer, $ename) = @_;
if ($program =~ /^https:\/\/gist\.github\.com\/[^\/]+?\/\p{HexDigit}+$/) {
my $page = `curl -s $program`;
$page =~ /<a\b[^>]+?\btitle="View Raw"[^>]+?\bhref="([^"]+)"/;
if ($1) { $program = decode_utf8 `curl -s $1` } else { return 'gist not found' };
$page =~ /<a\b[^>]+?\baria-label="View Raw"[^>]+?\bhref="([^"]+)"/;
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 e683ad0

Please sign in to comment.