.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "WWW::Shorten 3pm" .TH WWW::Shorten 3pm "2012-04-16" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" WWW::Shorten \- Interface to URL shortening sites. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 9 \& use WWW::Shorten \*(AqLinkz\*(Aq; \& use WWW::Shorten \*(AqMakeAShorterLink\*(Aq; \& use WWW::Shorten \*(AqMetamark\*(Aq; \& use WWW::Shorten \*(AqNotLong\*(Aq; \& use WWW::Shorten \*(AqOneShortLink\*(Aq; \& use WWW::Shorten \*(AqShorl\*(Aq; \& use WWW::Shorten \*(AqTinyClick\*(Aq; \& use WWW::Shorten \*(AqTinyLink\*(Aq; \& use WWW::Shorten \*(AqTinyURL\*(Aq; \& \& # Individual modules have have their \& # own syntactic variations. \& \& # See the documentation for the particular \& # module you intend to use for details, trips \& # and traps. \& \& $short_url = makeashorterlink($long_url); \& \& $long_url = makealongerlink($short_url); \& \& # If you don\*(Aqt like the function names: \& use WWW::Shorten \*(AqMetamark\*(Aq, \*(Aq:short\*(Aq; \& $short_url = short_link( $long_url ); \& $long_url = long_link( $short_url ); .Ve .SH "ABSTRACT" .IX Header "ABSTRACT" A Perl interface to \s-1URL\s0 shortening sites. These sites maintain databases of long URLs, each of which has a unique identifier. .SH "DESCRIPTION" .IX Header "DESCRIPTION" The function \f(CW\*(C`makeashorterlink\*(C'\fR will call the relevant web site passing it your long \s-1URL\s0 and will return the shorter version. .PP The function \f(CW\*(C`makealongerlink\*(C'\fR does the reverse. \f(CW\*(C`makealongerlink\*(C'\fR will accept as an argument either the full shortened \s-1URL\s0 or just the identifier. .PP If anything goes wrong, then either function will return \f(CW\*(C`undef\*(C'\fR. .SH "Subroutines" .IX Header "Subroutines" .SS "import" .IX Subsection "import" Called when the module is \f(CW\*(C`use\*(C'\fRd. Loads the correct sub-module .SS "\s-1EXPORT\s0" .IX Subsection "EXPORT" makeashorterlink, makealongerlink .PP Or, if you specify \f(CW\*(C`:short\*(C'\fR on the import line, you instead get \f(CW\*(C`short_link\*(C'\fR and \f(CW\*(C`long_link\*(C'\fR. If you explicitly want the default set, use \f(CW\*(C`:default\*(C'\fR. .PP Actually these functions are exported from the relevant subclass. .SH "COMMAND LINE PROGRAM" .IX Header "COMMAND LINE PROGRAM" A very simple program called \fIshorten\fR is supplied in the distribution's \fIbin\fR folder. This program takes a \s-1URL\s0 and gives you a shortened version of it. .SH "EXAMPLES and PROGRAMS" .IX Header "EXAMPLES and PROGRAMS" Adam Kessel wrote \fIshorlfilter\fR, a program that uses \f(CW\*(C`WWW::Shorten\*(C'\fR to filter a file, converting long URLs to short ones. .PP .Vb 1 \& http://bostoncoop.net/adam/shorlfilter .Ve .PP There is also a \fIbin\fR directory in this distribution which contains a sample program. .SH "NO LONGER SUPPORTED" .IX Header "NO LONGER SUPPORTED" The URL-shortening industry is pretty volatile. Many sites exist for a while and then go away. The most famous of those is probably Make A Shorter Link (the site that originally inspired this suite of modules). \s-1MASL\s0 has been acquired by TinyURL.com and no longer exists. .PP Here is a list of sites that were once supported by this module and are no longer with us: .IP "MakeAShorterLink" 4 .IX Item "MakeAShorterLink" .PD 0 .IP "BabyURL" 4 .IX Item "BabyURL" .IP "EkDk" 4 .IX Item "EkDk" .IP "qURL (although the differently capitalised Qurl.com now uses their old domain)" 4 .IX Item "qURL (although the differently capitalised Qurl.com now uses their old domain)" .IP "ShortLink" 4 .IX Item "ShortLink" .IP "SmLnk" 4 .IX Item "SmLnk" .IP "URLjr" 4 .IX Item "URLjr" .IP "V3" 4 .IX Item "V3" .PD .PP See Joshua Schachter's blog entry at http://joshua.schachter.org/2009/04/on\-url\-shorteners.html for some very interesting discussion on some problems that can be caused by the volatility of this part of the web industry. .SH "RELATED MODULES" .IX Header "RELATED MODULES" .SS "Similar Aim" .IX Subsection "Similar Aim" WWW::MakeAShorterLink is what this module was originally based upon. That module is obsoleted by WWW::Shorten::MakeAShorterLink, one of the many subclasses of WWW::Shorten. Of course, with the demise of Make A Shorter Link, neither the obsolete module nor it's replacement are of any use. .SS "Same Area, Different Purpose" .IX Subsection "Same Area, Different Purpose" CGI::Shorten provides building blocks for you to create your own \s-1URL\s0 shortening service. It provides routines to shoretn a \s-1URL\s0, lengthen one, and it keeps a store. Nice and easy. .SH "THANKS" .IX Header "THANKS" Dave Cross for WWW::MakeAShorterLink .PP Alex Page for the original \s-1LWP\s0 hacking on which Dave based his code. .PP Simon Batistoni for giving the \f(CW\*(C`makealongerlink\*(C'\fR idea to Dave. .PP Eric Hammond for writing the NotLong variant. .PP Shashank Tripathi for providing both SnipURL.com and advice on the module. .PP Kevin Gilbertson (Gilby) supplied information on the TinyURL \s-1API\s0. .PP Matt Felsen (mattf) wanted shorter function names. .PP Ask Bjoern Hansen for providing both Metamark.net and advice on the module. .PP Martin Thurn for helping me notice a bug and for a suggestion regarding \&\fI\s-1MASL\s0.pm\fR. .PP Jon and William (jon and wjr at smlnk.com respectively) for providing SmLnk.com. .PP P J Goodwin for providing the code for WWW::Shorten::OneShortLink. .PP And especial thanks to all providers of these services. .SH "BUGS, REQUESTS, COMMENTS" .IX Header "BUGS, REQUESTS, COMMENTS" Support for this module is supplied using the \s-1CPAN\s0 \s-1RT\s0 system via the web or email: .PP .Vb 2 \& http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW\-Shorten \& ( shorter URL: http://xrl.us/rfb ) \& \& bug\-www\-shorten@rt.cpan.org .Ve .PP This makes it much easier for me to track things and thus means your problem is less likely to be neglected. .SH "LICENCE AND COPYRIGHT" .IX Header "LICENCE AND COPYRIGHT" WWW::Shorten::NotLong copyright (c) Eric Hammond . .PP Other modules copyright (c) Magnum Solutions Ltd., 2007. All rights reserved. .PP This module is free software. You can redistribute it and/or modify it under the terms of the Artistic License 2.0. .PP This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. .SH "AUTHOR" .IX Header "AUTHOR" Original Iain Truskett .PP Based on WWW::MakeAShorterLink by Dave Cross .PP In 2004 Dave Cross took over the maintenance of this distribution following the death of Iain Truskett. .SH "SEE ALSO" .IX Header "SEE ALSO" perl, CGI::Shorten.