Permalink
Browse files

Merge pull request #4 from raydiak/master

Untested attempt to fix gist loading
  • Loading branch information...
2 parents b0e08cf + 141ae5b commit 228beb25c7ad16b2f8d1c25d95313beb6fec5006 @FROGGS FROGGS committed Mar 8, 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 228beb2

Please sign in to comment.