Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created March 18, 2017 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/9d9783ab1d74a6c21f69241daee7e813 to your computer and use it in GitHub Desktop.
Save zoffixznet/9d9783ab1d74a6c21f69241daee7e813 to your computer and use it in GitHub Desktop.
use JSON::Fast;
use HTTP::UserAgent;
my $job = ua-get-json 'https://api.travis-ci.org/jobs/212455149';
$job<log>.lc ~~ m/
[
"git error: fatal: unable to access"
| "git error: error: rpc failed"
| 'the command "git fetch origin +refs/pull/' \d+ '/merge:" failed and exited with 128 during .'
]
/;
say "Done matching; measure the RAM!";
sleep;
sub ua-get-json ($url) {
my $res = HTTP::UserAgent.new.get: $url;
fail $res.status-line unless $res.is-success;
from-json $res.content;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment