diff options
author | David Phillips <dbphillipsnz@gmail.com> | 2015-06-06 23:36:37 +1200 |
---|---|---|
committer | David Phillips <dbphillipsnz@gmail.com> | 2015-06-06 23:36:37 +1200 |
commit | 494f069b6015133fb18b9ebb41a6e9beef090736 (patch) | |
tree | 3fda3d77b39da5576e5a9556713345e982a182d0 /svgcaptcha-parser | |
parent | 230227d9e233c033f19603c03f70de784e8107e2 (diff) | |
download | svgcaptcha-parser-494f069b6015133fb18b9ebb41a6e9beef090736.tar.xz |
Switched from curl to HTTP::Tiny
Diffstat (limited to 'svgcaptcha-parser')
-rwxr-xr-x | svgcaptcha-parser | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/svgcaptcha-parser b/svgcaptcha-parser index af98720..fd65c8d 100755 --- a/svgcaptcha-parser +++ b/svgcaptcha-parser @@ -4,11 +4,11 @@ use strict; use warnings; use XML::Simple; - +use HTTP::Tiny; # Fetch fresh svg and parse it -die("Failed to download new svg: $!\n") unless my $raw_svg = `curl -s http://svgcaptcha.com/captcha.php`; - +my $response = HTTP::Tiny->new->get('http://svgcaptcha.com/captcha.php') or die("Failed to download new SVG: $!\n"); +my $raw_svg = $response->{content}; my $svg = XMLin($raw_svg, KeyAttr => {"text", "x"})->{"text"}; |