Skip to content

Commit e683ad0

Browse files
committed
Unbusticate evalbot execution of gists
Chase the ever changing URL extraction scheme to access the raw gist.
1 parent e3a593d commit e683ad0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/EvalbotExecuter.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ sub run {
8383
my ($program, $executer, $ename) = @_;
8484
if ($program =~ /^https:\/\/gist\.github\.com\/[^\/]+?\/\p{HexDigit}+$/) {
8585
my $page = `curl -s $program`;
86-
$page =~ /<a\b[^>]+?\btitle="View Raw"[^>]+?\bhref="([^"]+)"/;
87-
if ($1) { $program = decode_utf8 `curl -s $1` } else { return 'gist not found' };
86+
$page =~ /<a\b[^>]+?\baria-label="View Raw"[^>]+?\bhref="([^"]+)"/;
87+
if ($1) { $program = decode_utf8 `curl -s https://gist.github.com$1` } else { return 'gist not found' };
8888
} elsif ($program =~ /^https:\/\/github\.com\/([^\/]+\/[^\/]+)\/blob\/([^\/]+\/[^\/].*)$/) {
8989
my ($project, $file) = ($1, $2);
9090
my $page = `curl -s $program`;

0 commit comments

Comments
 (0)