Skip to content

p5-shorten/www-shorten-snipurl

Repository files navigation

NAME

WWW::Shorten::SnipURL - Perl interface to http://SnipURL.com

SYNOPSIS

use strict;
use warnings;

use WWW::Shorten 'SnipURL'; # recommended
# use WWW::Shorten::SnipURL; # also available

my $long_url = 'http://www.foo.com/bar/';
my $short_url = makeashorterlink($long_url);

$long_url  = makealongerlink($short_url);

DESCRIPTION

WARNING: http://snipurl.com does not provide an API. We must scrape the resulting HTML.

* Also, their service has been up and down quite a bit lately. We have disabled live tests due to this.

* You have been warned. We suggest using another WWW::Shorten service.

A Perl interface to the web service http://SnipURL.com. The service maintains a database of long URLs, each of which has a unique identifier or nickname. For more features, please visit http://snipurl.com/features.

Functions

WWW::Shorten::SnipURL makes the following functions available.

makeashorterlink

my $short = makeashorterlink('http://www.example.com/');

The function makeashorterlink will call use the web service, passing it your long URL and will return the shorter version.

makealongerlink

my $long = makealongerlink('ablkjadf2314sfd');
my $long = makealongerlink('http://snipurl.com/ablkjadf2314sfd');

The function makealongerlink does the reverse. makealongerlink will accept as an argument either the full URL or just the identifier.

If anything goes wrong, then either function will return undef.

AUTHOR

Shashank Tripathi [email protected]

CONTRIBUTORS

COPYRIGHT AND LICENSE

See the main WWW::Shorten docs.

SEE ALSO

WWW::Shorten, http://shorl.com/

About

WWW::Shorten Plugin to interact with snipurl.com

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages