Librairie officielle

Créez des liens courts sécurisés depuis votre site en Perl. La version actuelle est 1.22..

CPAN

The library is available on CPAN.

Téléchargement

You can download the Perl library from CPAN or here.

Code

#!/usr/bin/perl -w
use strict;
use warnings;
use Carp;
use WWW::Shorten::Safe;
my $url = "http://www.example.com";
my $safe = WWW::Shorten::Safe->new();
$safe->shorten(URL => $url);
print "Short: ",  $safe->{safeurl}, "\n";
$safe->expand(URL => $safe->{safeurl});
print "Long: ", $safe->{longurl}, "\n";
my $info = $safe->info(URL => $url);
print "Clicks: ", $info->{clicks}, "\n";

Résultat

Short: http://safe.mn/d
Long: http://www.reviews-web-hosting.com/
Clicks: 185