Permalink
Browse files

Fix gist loading

  • Loading branch information...
1 parent b0e08cf commit 141ae5b2e2e5bb8e090d1d2ef31240315ba02628 @raydiak raydiak committed Mar 7, 2014
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/EvalbotExecuter.pm
View
@@ -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 title="View Raw" href="([^"]+)"/;
- if ($1) { $program = decode_utf8 `curl -s https://gist.github.com$1` } else { return 'gist not found' };
+ $page =~ /<a\b[^>]+?\btitle="View Raw"\b[^>]+?\bhref="([^"]+)"/;
+ if ($1) { $program = decode_utf8 `curl -s $1` } else { return 'gist not found' };
} elsif ($program =~ /^https:\/\/github\.com\/([^\/]+\/[^\/]+)\/blob\/([^\/]+\/[^\/].*)$/) {
my ($project, $file) = ($1, $2);
my $page = `curl -s $program`;

0 comments on commit 141ae5b

Please sign in to comment.