Open chrisjrob opened 8 years ago
Frustratingly it seems that I am passing the correct URL to the WWW:Shorten makeashorterlink function. In other words this must be a bug in that.
Tried removing the libwww-shorten-perl package and replacing it with the latest in cpan, but no better.
Replaced tinyurl with my own module, but suffers from the same problem. Basically the module boils down to the following line:
my $resp = $ua->post("http://tinyurl.com/api-create.php", [url => $url, source => "PerlAPI-3.093",]);
And that is returning a $resp->content value of the defunct tinyurl of http://tinyurl.com/hoaemm6.
Tested in curl with:
curl -X POST http://tinyurl.com/api-create.php -F 'url=http://www.autotrader.ca/newsfeatures/20160719/why-do-motorcyclists-do-that/'
And it worked perfectly. The only difference in perl is that we are adding "source", but removing that makes no difference. Nor does changing user agent.
Suspected regex issue, but somehow
http://www.autotrader.ca/newsfeatures/20160719/why-do-motorcyclists-do-that/
Is being shortened to
http://www.autotrader.ca/20160719/why-do-motorcyclists-do-that/
before being passed to tinyurl, which then returns:
http://tinyurl.com/hoaemm6 - 404 Not Found.