Subject: | Tests fail for shorl.com |
Hi,
The test for shorl.com are failing because, well, it doesn't work with shorl.com ;).
The problem is that it returns a page saying that a URL hasn't been submitted. I took a guess
that they'd stopped accepting POST requests and if you turn the query in to a GET it all
seems to work.
Anyway, the following patch makes it work for me. It does mean adding URI::Escape as a
dependancy.
Cheers
Struan
--- lib/WWW/Shorten/Shorl.pm.old 2010-01-16 16:57:09.000000000 +0000
+++ lib/WWW/Shorten/Shorl.pm 2010-01-16 17:13:36.000000000 +0000
@@ -27,6 +27,7 @@
use 5.006;
use strict;
use warnings;
+use URI::Escape;
use base qw( WWW::Shorten::generic Exporter );
our @EXPORT = qw(makeashorterlink makealongerlink);
@@ -51,8 +52,8 @@
{
my $url = shift or croak 'No URL passed to makeashorterlink';
my $ua = __PACKAGE__->ua();
- my $shorl = 'http://shorl.com/create.php';
- my $resp = $ua->post($shorl, [ url => $url ]);
+ my $shorl = 'http://shorl.com/create.php?url=';
+ my $resp = $ua->get($shorl . uri_escape( $url ));
return unless $resp->is_success;
if ($resp->content =~ m!
\QShorl:\E