WWW-Shorten-3.094000755001750001750 014022724551 15002 5ustar00cwhitenercwhitener000000000000README100755001750001750 654414022724551 15757 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094NAME WWW::Shorten - Interface to URL shortening sites. SYNOPSIS #!/usr/bin/env perl use strict; use warnings; use WWW::Shorten 'TinyURL'; # Recommended # use WWW::Shorten 'Bitly'; # or one of the others # Individual modules have have their own syntactic variations. # See the documentation for the particular module you intend to use for details my $url = 'https://metacpan.org/pod/WWW::Shorten'; my $short_url = makeashorterlink($url); my $long_url = makealongerlink($short_url); # - OR - # If you don't like the long function names: use WWW::Shorten 'TinyURL', ':short'; my $short_url = short_link($url); my $long_url = long_link( $short_url ); DESCRIPTION A Perl interface to various services that shorten URLs. These sites maintain databases of long URLs, each of which has a unique identifier. DEPRECATION NOTICE The following shorten services have been deprecated as the endpoints no longer exist or function: * WWW::Shorten::LinkToolbot * WWW::Shorten::Linkz * WWW::Shorten::MakeAShorterLink * WWW::Shorten::Metamark * WWW::Shorten::TinyClick * WWW::Shorten::Tinylink * WWW::Shorten::Qurl * WWW::Shorten::Qwer When version 3.100 is released, these deprecated services will not be part of the distribution. SHORTEN APP A very simple program called shorten is supplied in the distribution's bin folder. This program takes a URL and gives you a shortened version of it. BUGS, REQUESTS, COMMENTS Please submit any issues you might have. We appreciate all help, suggestions, noted problems, and especially patches. * If you know of a shorten service that we don't already have, make your own service and release it as a separate module, like WWW::Shorten::Googl or WWW::Shorten::Bitly. Alternatively, you can let us know and we'll be happy to work it up for you. AUTHOR Iain Truskett "spoon@cpan.org" CONTRIBUTORS * Alex Page -- for the original LWP hacking on which Dave based his code. * Ask Bjoern Hansen -- providing WWW::Shorten::Metamark * Chase Whitener "capoeirab@cpan.org" * Dave Cross dave@perlhacks.com -- Authored WWW::MakeAShorterLink on which this was based * Eric Hammond -- writing WWW::Shorten::NotLong * Jon and William (wjr) -- smlnk services * Kazuhiro Osawa "yappo@cpan.org" * Kevin Gilbertson (Gilby) -- TinyURL API information * Martin Thurn -- bug fixes * Matt Felsen (mattf) -- shorter function names * Neil Bowers "neilb@cpan.org" * PJ Goodwin -- code for WWW::Shorten::OneShortLink * Shashank Tripathi "shank@shank.com" -- for providing WWW::Shorten::SnipURL * Simon Batistoni -- giving the `makealongerlink` idea to Dave. * Everyone else we might have missed. In 2004 Dave Cross took over the maintenance of this distribution following the death of Iain Truskett. In 2016, Chase Whitener took over the maintenance of this distribution. LICENSE AND COPYRIGHT Copyright (c) 2002 by Iain Truskett. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO CGI::Shorten, WWW::Shorten::Simple Changes100755001750001750 2130014022724551 16375 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094Revision history for WWW-Shorten 3.094 2021-03-12 - Fixed up some documentation issues. - No longer reference deprecated services in the docs. 3.093 2016-03-25 - lin.kz no longer exists, so WWW::Shorten::Linkz is deprecated - added deprecation/removal notices in accordance with issue #8 - Folded ::Qurl into the deprecated modules - Folded ::Qwer into the deprecated modules - Temporarily hault live testing against TinyURL with ugly hack - Bump Perl requirement to 5.8.1 3.092 2016-03-20 - Clear note about how to contribute other shorten services. Thanks, @ambs - Updated shorten CLI app to add a lengthen option. #9 - Pared down the requirements - re-release with GNU tar 3.091 2016-03-17 - Fixed typo on ::_dead (Thanks, @neilb) - Add synopsis to ::_dead - Cleaned up contributors, alphabetized - Cleaned up the copyright and license confusion 3.090 2016-03-16 - changed to Dist::Zilla - added author tests - Cleaned up documentation - Cleaned up Changes file - added deprecation notices - Cleaned up the Readme.md quite a bit 3.08 2015-12-15 - Dave Cross (DAVECROSS) - added .gitignore - fix some formatting - Devel::Cover - fix tinurl tests a bit - Corrected INSTALL instructions 3.06 2014-09-15 - Dave Cross (DAVECROSS) - removed metamark as it's dead 3.05 2014-05-06 - Dave Cross (DAVECROSS) - Documentation typo - TinyURL test fix - added TravisCI - Modernized Readme 3.04 2013-08-22 - Dave Cross (DAVECROSS) - removed remnants of SnipURL - finished moving shorl to a separate dist - Config::Auto dep added - default to supported service - bin/shorten better examples - (YAPPO) - shorl POST verb 3.03 2012-04-06 - Dave Cross (DAVECROSS) - License cleanup - Added META.json 3.02 2010-12-06 - Dave Cross (DAVECROSS) - bin/shorten: service choice is now smarter - added MYMETA.yml to MANIFEST.SKIP 3.01 2010-12-06 - Dave Cross (DAVECROSS) - bin/shorten: Default to using a service that we currently support 3.00 2010-01-20 - Dave Cross (DAVECROSS) - shorl.com now uses POST verb - removed ::Shorl in prep for a separate dist 2.06 2009-11-21 - Dave Cross (DAVECROSS) - removed NotLong in prep for a separate dist - Removed OneShortLink in prep for a separate dist 2.05 2009-09-18 - Dave Cross (DAVECROSS) - finished up removing SnipURL 2.04 2009-09-08 - Dave Cross (DAVECROSS) - Removed WWW::Shorten::SnipURL to prep for a separate dist - Doc improvements - added $DEFAULT_SERVICE - removed a number of no longer in service modules 2.03 2009-03-19 - Dave Cross (DAVECROSS) - fix tinyurl tests - fix shorl tests - remove signing from Build.PL 2.02 2009-02-02 - Dave Cross (DAVECROSS) - fix perl 5.006 requirement 2.01 2008-06-30 - Dave Cross (DAVECROSS) - build fixes 2.00 2008-06-28 - Dave Cross (DAVECROSS) - mark tinylink as dead until we can fix the problem 1.100 2008-04-20 - Dave Cross (DAVECROSS) - fixed tests for snipurl 1.99 2008-04-19 - Dave Cross (DAVECROSS) - removed sample config for bin/shorten - add script_files to Build.PL 1.98 2008-04-14 - Dave Cross (DAVECROSS) - Added WWW::Shorten::LinkToolbot - added tests for linktoolbot - Switched to Build.PL - Fixed ::Shorl to mimick their changes - Fixed lots of documentation - removed tinyclick.com support - removed makeashorterlink.com support - removed babyurl support - manual versioning - fixed email and copyright in docs 1.97 2005-10-10 - Dave Cross (DAVECROSS) - Re-add support for 1sl.net 1.95 2005-05-24 - Dave Cross (DAVECROSS) - skip broken lin.kz tests - fix pod 1.94 2005-05-19 - Dave Cross (DAVECROSS) - removed some dead services - Fixed ::Shorl to accomodate their changes - Removed v3 service - Removed 1sl service 1.88 2004-10-30 - Dave Cross (DAVECROSS) - Improve coverage in tests - new test files - removed some dead services 1.88 2004-10-25 - Dave Cross (DAVECROSS) - Fix VERSION - remove no strict 'refs' - generate SIGNATURE - fix tests - fix regular expression 1.88 2004-10-24 - Dave Cross (DAVECROSS) - Changed author info - Get Version from tags - Removed Changes file to get them from CVS 1.88 2003-11-12 - Iain Truskett (SPOON) - Tidied up return values and authorship - EkDk service removed. - ShortLink service removed. - qURL service removed - TinyClick made their URLs slightly harder to find - Test fixes - Added OneShortLink, http://1sl.net/ - fix change in SmLnk ID scheme - Mention CGI::Shorten - Added links to search.cpan.org and backpan - Use Class::Factory::Util to provide randomised selection 1.87 2003-09-07 - Iain Truskett (SPOON) - Better abstract - Added lin.kz 1.86 2003-09-02 - Iain Truskett (SPOON) - Assorted documentation nit fixing - Fixed Eric's email - Added BabyURL.com - Fixed wrong URL in docs. - Removed trailing slash in deparse URL - Added URLjr.com 1.85 2003-08-29 - Iain Truskett (SPOON) - Added v3.net 1.84 2003-08-29 - Iain Truskett (SPOON) - Fixed qURL documentation - Added TinyLink.com support - SmLnk.pm now uses the SmLnk API - changed URL for shorlfilter 1.83 2003-08-26 - Iain Truskett (SPOON) - Added qurl.net - Mentioned shorlfilter. 1.82 2003-07-23 - Iain Truskett (SPOON) - Removed Fcol support - QuickOnes.org doesn't exist any more - Now using RT.cpan.org - Cleaned up some tests - Unified version numbers - Added ShortLink.us 1.5.8 2003-03-11 - Iain Truskett (SPOON) - Improved tests - Added BUGS section to all PODs - shorten script souped up. Can now be configured - shorten now configurable - sample config file provided 1.5.7 2003-03-09 - Iain Truskett (SPOON) - Modules return undef with any error - MakeAShorterLink.pm has minor POD fixups. - MASL now returns the original URL if it was too short. - Added link to NotLong's comparison page to WWW::Shorten. - Revised BUGS section of WWW::Shorten. Others will be done. 1.5.6 2003-03-05 - Iain Truskett (SPOON) - Metamark uses POST rather than GET now. - Ask mentioned in various bits. - Added 'bin/shorten' to the manifest (it was left out) - Added TinyClick.com - Remove redundant tests - Added Test::Pod - Added SERVICES section 1.5.5 2003-01-07 - Iain Truskett (SPOON) - Build chain fix 1.5.4 3003-01-07 - Iain Truskett (SPOON) - Tests no longer use a dave.org in favor of perl.dellah.org - AUTHORS list added. - ChangeLog added - Added Ask's Metamark service. - Module::Build uses META.yml now rather than .yaml - Smlnk test added - SnipURL.com modified their API. Code updated. - Added 'shorten'. A useful little program. - Added Metamark and 'shorten' to the docs. 1.5.2 2002-11-01 - Iain Truskett (SPOON) - Versions moved to x.yy, and aren't taken from CVS ids - New tests added - import() for WWW::Shorten simplified by shunting stuff to the base class. - Added SmLnk.com - Updated Shorten.pm to mention the EdDk, Fcol and SmLnk. 1.5.1 2002-10-29 - Iain Truskett (SPOON) - Build.PL fix - ::SnipURL $debug mode 1.5.0 2002-10-25 - Iain Truskett (SPOON) - Moved to Module::Build - SIGNATURE added. - Default style is 'MakeAShorterLink'. - THANKS section added. - LICENSE AND COPYRIGHT section added. - SnipURL.pm uses the API interface. - Auxiliary files cleaned up. - Basic tests added. - Fcol.org and add.redir.ek.dk added. - Tests for Fcol and EkDk added. 1.4.2 2002-09-21 - Iain Truskett (SPOON) - Fixed a Makefile.PL problem 1.4.1 2002-09-21 - Iain Truskett (SPOON) - ::SnipURL - Remove mention of ($url,$password) syntax - Updated tests - fixed scoping problems 1.4 2002-09-20 - Iain Truskett (SPOON) - refactored WWW::Shorten::generic - refactored masl - Added NotLong, QuickOnes, SnipURL - Refactored ::TinyURL to use the ::generic interface - Added lots of tests 1.3.2 2002-09-16 - Iain Truskett (SPOON) - Added bug report location - Fixed Readme - Fixed TinyURL - Fixed MakeAShorterLink - Fixed Shorl 1.3.1 2002-09-04 - Iain Truskett (SPOON) - Fixed versioning - Fixed Readme - Added/updated documentation 1.2 2002-08-29 - Iain Truskett (SPOON) - Original Release LICENSE100755001750001750 4366014022724551 16124 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094This software is copyright (c) 2002 by Iain Truskett. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2002 by Iain Truskett. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. 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. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2002 by Iain Truskett. This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End cpanfile100755001750001750 150614022724551 16574 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094on 'runtime' => sub { requires 'strict'; requires 'warnings'; requires 'Carp'; requires 'Getopt::Long' => '2.4'; # the shorten app requires 'LWP::UserAgent' => '5.835'; requires 'Try::Tiny' => '0.24'; }; on 'configure' => sub { requires 'ExtUtils::MakeMaker' => '6.52'; }; on 'test' => sub { requires 'Test::More' => '0.88'; }; on 'develop' => sub { requires 'Dist::Zilla'; requires 'Dist::Zilla::PluginBundle::Starter' => 'v4.0.0'; requires 'Dist::Zilla::Plugin::MinimumPerl'; requires 'Pod::Coverage::TrustPod'; requires 'Test::CheckManifest' => '1.29'; requires 'Test::CPAN::Changes' => '0.4'; requires 'Test::CPAN::Meta'; requires 'Test::Kwalitee' => '1.22'; requires 'Test::Pod::Coverage'; requires 'Test::Pod::Spelling::CommonMistakes' => '1.000'; }; dist.ini100755001750001750 430414022724551 16533 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094name = WWW-Shorten author = Iain Truskett license = Perl_5 copyright_holder = Iain Truskett copyright_year = 2002 [ReadmeAnyFromPod / Markdown_Readme] type = gfm source_filename = lib/WWW/Shorten.pm filename = README.md location = root [Regenerate::AfterReleasers] plugin = Markdown_Readme [@Starter::Git] revision = 5 -remove = Test::Compile ; fails on many deprecated modules managed_versions = 1 installer = MakeMaker::Awesome RewriteVersion.global = 1 NextRelease.format = %-9v %{yyyy-MM-dd}d regenerate = Makefile.PL regenerate = META.json regenerate = README.md regenerate = LICENSE regenerate = t/00-report-prereqs.t Git::Check.allow_dirty = META.json [Prereqs::FromCPANfile] [MinimumPerl] perl = 5.008 [Deprecated] module = WWW::Shorten::LinkToolbot module = WWW::Shorten::Linkz module = WWW::Shorten::MakeAShorterLink module = WWW::Shorten::Metamark module = WWW::Shorten::TinyClick module = WWW::Shorten::Tinylink module = WWW::Shorten::Qwer module = WWW::Shorten::Qurl [Git::Contributors] [GithubMeta] issues = 1 user = p5-shorten [GitHubREADME::Badge] badges = github_actions/linux badges = github_actions/macos badges = github_actions/windows [CheckChangeLog] [CheckChangesHasContent] [Test::ChangesHasContent] [Test::PAUSE::Permissions] [Test::Kwalitee] skiptest = no_symlinks [Test::Version] filename_match = qr/Shorten\.pm$/ [Test::Pod::Coverage::Configurable] skip = WWW::Shorten::_dead skip = WWW::Shorten::LinkToolbot skip = WWW::Shorten::Linkz skip = WWW::Shorten::MakeAShorterLink skip = WWW::Shorten::Metamark skip = WWW::Shorten::TinyClick skip = WWW::Shorten::Tinylink skip = WWW::Shorten::Qwer skip = WWW::Shorten::Qurl [Test::PodSpelling] wordlist = Pod::Wordlist spell_cmd = aspell list stopword = CPAN stopword = github stopword = stopwords stopword = wordlist stopword = Iain stopword = truskett stopword = merchantability stopword = makeashorterlink stopword = makealongerlink stopword = ua stopword = Batistoni stopword = shashank stopword = mattf stopword = Tripathi stopword = Thurn stopword = Gilby stopword = Gilbertson stopword = Bjoern stopword = Felsen stopword = Kessel stopword = jon stopword = wjr stopword = Schachter stopword = PJ stopword = smlnk META.yml100755001750001750 503314022724551 16340 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094--- abstract: 'Interface to URL shortening sites.' author: - 'Iain Truskett ' build_requires: ExtUtils::MakeMaker: '0' File::Spec: '0' Test::More: '0.88' perl: '5.008' configure_requires: ExtUtils::MakeMaker: '6.52' perl: '5.008' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.017, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: WWW-Shorten no_index: directory: - eg - examples - inc - share - t - xt provides: WWW::Shorten: file: lib/WWW/Shorten.pm version: '3.094' WWW::Shorten::LinkToolbot: file: lib/WWW/Shorten/LinkToolbot.pm version: '3.094' x_deprecated: 1 WWW::Shorten::Linkz: file: lib/WWW/Shorten/Linkz.pm version: '3.094' x_deprecated: 1 WWW::Shorten::MakeAShorterLink: file: lib/WWW/Shorten/MakeAShorterLink.pm version: '3.094' x_deprecated: 1 WWW::Shorten::Metamark: file: lib/WWW/Shorten/Metamark.pm version: '3.094' x_deprecated: 1 WWW::Shorten::Qurl: file: lib/WWW/Shorten/Qurl.pm version: '3.094' x_deprecated: 1 WWW::Shorten::Qwer: file: lib/WWW/Shorten/Qwer.pm version: '3.094' x_deprecated: 1 WWW::Shorten::TinyClick: file: lib/WWW/Shorten/TinyClick.pm version: '3.094' x_deprecated: 1 WWW::Shorten::TinyURL: file: lib/WWW/Shorten/TinyURL.pm version: '3.094' WWW::Shorten::Tinylink: file: lib/WWW/Shorten/Tinylink.pm version: '3.094' x_deprecated: 1 WWW::Shorten::UserAgent: file: lib/WWW/Shorten/UserAgent.pm version: '3.094' WWW::Shorten::generic: file: lib/WWW/Shorten/generic.pm version: '3.094' requires: Carp: '0' Getopt::Long: '2.4' LWP::UserAgent: '5.835' Try::Tiny: '0.24' perl: '5.008' strict: '0' warnings: '0' resources: bugtracker: https://github.com/p5-shorten/www-shorten/issues homepage: https://github.com/p5-shorten/www-shorten repository: https://github.com/p5-shorten/www-shorten.git version: '3.094' x_contributors: - 'Alexandr Ciornii ' - 'ambs ' - 'Chase Whitener ' - 'Dave Cross ' - 'Derek Schrock ' - 'Kazuhiro Osawa ' - 'Michiel Beijen ' - 'Mohammad S Anwar ' - '(no author) <(no author)>' x_generated_by_perl: v5.32.0 x_serialization_backend: 'YAML::Tiny version 1.73' x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later' MANIFEST100755001750001750 207614022724551 16224 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.017. Changes LICENSE MANIFEST META.json META.yml Makefile.PL README bin/shorten cpanfile dist.ini lib/WWW/Shorten.pm lib/WWW/Shorten/LinkToolbot.pm lib/WWW/Shorten/Linkz.pm lib/WWW/Shorten/MakeAShorterLink.pm lib/WWW/Shorten/Metamark.pm lib/WWW/Shorten/Qurl.pm lib/WWW/Shorten/Qwer.pm lib/WWW/Shorten/TinyClick.pm lib/WWW/Shorten/TinyURL.pm lib/WWW/Shorten/Tinylink.pm lib/WWW/Shorten/UserAgent.pm lib/WWW/Shorten/_dead.pm lib/WWW/Shorten/generic.pm t/00-load-default.t t/00-load-short.t t/00-report-prereqs.dd t/00-report-prereqs.t t/00load.t t/00load_a.t t/00load_b.t t/00noexp.t t/00sig.t t/90-dead.t t/91-dead-linktoolbot.t t/92-dead-metamark.t t/93-dead-masl.t t/94-dead-tinyclick.t t/95-dead-tinylink.t t/96-dead-linkz.t t/97-dead-qurl.t t/98-dead-qwer.t t/tinyurl.t xt/author/changes.t xt/author/kwalitee.t xt/author/manifest.t xt/author/pod-cm.t xt/author/pod-coverage.t xt/author/pod-spell.t xt/author/pod-syntax.t xt/release/changes_has_content.t xt/release/kwalitee.t xt/release/pause-permissions.t t000755001750001750 014022724551 15166 5ustar00cwhitenercwhitener000000000000WWW-Shorten-3.09400sig.t100755001750001750 22014022724551 16412 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/tuse Test::More tests => 1; eval "use Test::Signature 1.04"; SKIP: { skip "Test::Signature not installed.", 1 if $@; signature_ok(); } META.json100755001750001750 1113614022724551 16531 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094{ "abstract" : "Interface to URL shortening sites.", "author" : [ "Iain Truskett " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.017, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "WWW-Shorten", "no_index" : { "directory" : [ "eg", "examples", "inc", "share", "t", "xt" ] }, "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "6.52", "perl" : "5.008" } }, "develop" : { "requires" : { "Dist::Zilla" : "0", "Dist::Zilla::Plugin::MinimumPerl" : "0", "Dist::Zilla::PluginBundle::Starter" : "v4.0.0", "Pod::Coverage::TrustPod" : "0", "Test::CPAN::Changes" : "0.4", "Test::CPAN::Meta" : "0", "Test::CheckManifest" : "1.29", "Test::Kwalitee" : "1.22", "Test::More" : "0.88", "Test::PAUSE::Permissions" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08", "Test::Pod::Spelling::CommonMistakes" : "1.000", "Test::Spelling" : "0.12", "Test::Version" : "2.00" } }, "runtime" : { "requires" : { "Carp" : "0", "Getopt::Long" : "2.4", "LWP::UserAgent" : "5.835", "Try::Tiny" : "0.24", "perl" : "5.008", "strict" : "0", "warnings" : "0" } }, "test" : { "recommends" : { "CPAN::Meta" : "2.120900" }, "requires" : { "ExtUtils::MakeMaker" : "0", "File::Spec" : "0", "Test::More" : "0.88", "perl" : "5.008" } } }, "provides" : { "WWW::Shorten" : { "file" : "lib/WWW/Shorten.pm", "version" : "3.094" }, "WWW::Shorten::LinkToolbot" : { "file" : "lib/WWW/Shorten/LinkToolbot.pm", "version" : "3.094", "x_deprecated" : 1 }, "WWW::Shorten::Linkz" : { "file" : "lib/WWW/Shorten/Linkz.pm", "version" : "3.094", "x_deprecated" : 1 }, "WWW::Shorten::MakeAShorterLink" : { "file" : "lib/WWW/Shorten/MakeAShorterLink.pm", "version" : "3.094", "x_deprecated" : 1 }, "WWW::Shorten::Metamark" : { "file" : "lib/WWW/Shorten/Metamark.pm", "version" : "3.094", "x_deprecated" : 1 }, "WWW::Shorten::Qurl" : { "file" : "lib/WWW/Shorten/Qurl.pm", "version" : "3.094", "x_deprecated" : 1 }, "WWW::Shorten::Qwer" : { "file" : "lib/WWW/Shorten/Qwer.pm", "version" : "3.094", "x_deprecated" : 1 }, "WWW::Shorten::TinyClick" : { "file" : "lib/WWW/Shorten/TinyClick.pm", "version" : "3.094", "x_deprecated" : 1 }, "WWW::Shorten::TinyURL" : { "file" : "lib/WWW/Shorten/TinyURL.pm", "version" : "3.094" }, "WWW::Shorten::Tinylink" : { "file" : "lib/WWW/Shorten/Tinylink.pm", "version" : "3.094", "x_deprecated" : 1 }, "WWW::Shorten::UserAgent" : { "file" : "lib/WWW/Shorten/UserAgent.pm", "version" : "3.094" }, "WWW::Shorten::generic" : { "file" : "lib/WWW/Shorten/generic.pm", "version" : "3.094" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/p5-shorten/www-shorten/issues" }, "homepage" : "https://github.com/p5-shorten/www-shorten", "repository" : { "type" : "git", "url" : "https://github.com/p5-shorten/www-shorten.git", "web" : "https://github.com/p5-shorten/www-shorten" } }, "version" : "3.094", "x_contributors" : [ "Alexandr Ciornii ", "ambs ", "Chase Whitener ", "Dave Cross ", "Derek Schrock ", "Kazuhiro Osawa ", "Michiel Beijen ", "Mohammad S Anwar ", "(no author) <(no author)>" ], "x_generated_by_perl" : "v5.32.0", "x_serialization_backend" : "Cpanel::JSON::XS version 4.25", "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later" } 00load.t100755001750001750 26514022724551 16560 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/tuse strict; use warnings; use Test::More; BEGIN { use_ok('WWW::Shorten') or BAIL_OUT("Can't use module"); } can_ok('main', qw(makealongerlink makeashorterlink)); done_testing(); bin000755001750001750 014022724551 15473 5ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094shorten100755001750001750 702714022724551 17251 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/bin#!perl use 5.006; use strict; use warnings; use Getopt::Long 'GetOptions'; use Try::Tiny qw(try catch); use utf8; our $VERSION = '3.094'; # modernize Getopt::Long Getopt::Long::Configure(qw(default gnu_getopt no_auto_abbrev no_ignore_case)); GetOptions('s|service=s' => \my $service, 'l' => \my $long,); # eval in case we don't have Config::Auto installed my $config = try { require Config::Auto; return Config::Auto::parse(); } catch { warn "You must have Config::Auto in order to use a config file\n" unless $_ =~ /No config file/; {}; }; # Determine our service, default is TinyURL $service = $service || $ENV{SHORTEN_SERVICE} || $config->{service} || 'TinyURL'; $service = "WWW::Shorten::$service" unless $service =~ /^WWW::Shorten/; # Import it try { (my $mod = $service) =~ s/::/\//g; require "$mod.pm"; } catch { die "Error trying to use $service: $_\n"; }; # determine the method to use; my $method = $long ? 'makealongerlink' : 'makeashorterlink'; die "Sorry, $service can't $method\n" unless (my $call = $service->can($method)); # Get argument my $url = shift(@ARGV) || ''; die "No URL specified!\n" unless $url; unless ($long) { $url = "http://$url" unless $url =~ m[^\w+://]; } my $out = try { $call->($url); } catch { die "Error: $_\n"; }; # Output $out = $out || 'Error'; print "$out\n"; __END__ =head1 NAME shorten - CLI program to demonstrate use of WWW::Shorten =head1 SYNOPSIS # Default shortening service is Metamark $ shorten books.perl.org/book/171 http://xrl.us/dv8 # Change with an environment variable $ SHORTEN_SERVICE=TinyURL shorten books.perl.org/book/171 http://tinyurl.com/ye7gjf4 # Change with command line option $ shorten --service=TinyURL books.perl.org/book/171 http://tinyurl.com/ye7gjf4 # Change using config file $ cat ~/.shortenrc service = TinyURL $ shorten books.perl.org/book/171 http://tinyurl.com/ye7gjf4 # Lengthen a URL $ shorten -l http://tinyurl.com/ye7gjf4 =head1 CONFIGURATION The service used can be controlled in various ways. The program will use the first of the following values that it finds: =over =item * The value of the C<--service> command line option. =item * The value of the C environment variable. =item * The value of the C option from the configuration file (see below). =item * If none of the above options is found, the program defaults to using Metamark. =back =head1 CONFIGURATION FILE As we use the C module for configuration, shorten's fairly flexible when it comes to format. Configuration will be found in whichever of the following files comes first. shortenconfig ~/shortenconfig /etc/shortenconfig shorten.config ~/shorten.config /etc/shorten.config shortenrc ~/shortenrc /etc/shortenrc .shortenrc ~/.shortenrc /etc/.shortenrc Generally, I use the format: service = MakeAShorterLink which is simple and works. C is the only configuration keyword at present. Its value should be a correctly capitalized service name as per L's documentation. =head1 LICENSE AND COPYRIGHT Copyright 2002 - 2010, Magnum Solutions Ltd. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 AUTHOR Iain Truskett =head1 CONTRIBUTORS =over =item * Chase Whitener C =item * Dave Cross =back =head1 SEE ALSO L =cut 00noexp.t100755001750001750 36014022724551 16766 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/tuse strict; use warnings; use Test::More; use Try::Tiny qw(try catch); use WWW::Shorten::TinyURL; my $res = try { WWW::Shorten::TinyURL->import(':invalid'); undef } catch { $_ }; ok($res, 'Importing invalid tag failed'); done_testing(); 90-dead.t100755001750001750 33514022724551 16622 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/tuse strict; use warnings; use Test::More; use Try::Tiny qw(try catch); my $res = try {require WWW::Shorten::_dead; '' } catch { "inactive service $_" }; like($res, qr/inactive/, "::_dead is inactive"); done_testing(); tinyurl.t100755001750001750 347214022724551 17232 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/tuse strict; use warnings; use Try::Tiny qw(try catch); use WWW::Shorten::TinyURL; use Test::More; BEGIN { $ENV{'WWW-SHORTEN-TESTING'} = 1; }; my $url = 'https://metacpan.org/release/WWW-Shorten'; my $prefix = 'https://tinyurl.com/'; { my $err = try { makeashorterlink(); } catch { $_ }; ok($err, 'makeashorterlink: proper error response'); $err = undef; $err = try { makealongerlink(); } catch { $_ }; ok($err, 'makealongerlink: proper error response'); $err = undef; $err = makeashorterlink('http://www.google.com'); is($err, undef, 'makeashorterlink: proper error with wrong testing URL'); is($WWW::Shorten::TinyURL::_error_message, 'Incorrect URL for testing purposes', 'makeashorterlink: proper error message'); $err = undef; $err = makealongerlink('http://www.google.com'); is($err, undef, 'makealongerlink: proper error with wrong testing URL'); is($WWW::Shorten::TinyURL::_error_message, 'Incorrect URL for testing purposes', 'makealongerlink: proper error message'); $err = undef; } # shorter my $code = ''; my $short = makeashorterlink($url); is($WWW::Shorten::TinyURL::_error_message, '', 'makeashorterlink: no errors'); if ($short && $short =~ /(\w+)$/) { $code = $1; } is($short, 'https://tinyurl.com/abc12345', 'makeashorterlink: proper response'); is($code, 'abc12345', 'makeashorterlink: proper code'); is($short, $prefix.$code, 'makeashorterlink: URL exactly as we expected'); # longer my $longer = makealongerlink($prefix.$code); is($WWW::Shorten::TinyURL::_error_message, '', 'makealongerlink: no errors'); is($longer, $url, 'makealongerlink: proper response'); $longer = undef; $longer = makealongerlink($code); is($WWW::Shorten::TinyURL::_error_message, '', 'makealongerlink: no errors'); is($longer, $url, 'makealongerlink: proper response'); done_testing(); Makefile.PL100755001750001750 270014022724551 17037 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094# This Makefile.PL for WWW-Shorten was generated by # Dist::Zilla::Plugin::MakeMaker::Awesome 0.48. # Don't edit it but the dist.ini and plugins used to construct it. use strict; use warnings; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "Interface to URL shortening sites.", "AUTHOR" => "Iain Truskett ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => "6.52" }, "DISTNAME" => "WWW-Shorten", "EXE_FILES" => [ "bin/shorten" ], "LICENSE" => "perl", "NAME" => "WWW::Shorten", "PREREQ_PM" => { "Carp" => 0, "Getopt::Long" => "2.4", "LWP::UserAgent" => "5.835", "Try::Tiny" => "0.24", "strict" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "Test::More" => "0.88" }, "VERSION" => "3.094", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Carp" => 0, "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "Getopt::Long" => "2.4", "LWP::UserAgent" => "5.835", "Test::More" => "0.88", "Try::Tiny" => "0.24", "strict" => 0, "warnings" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION('6.63_03') } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); 00load_a.t100755001750001750 40514022724551 17054 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/tuse strict; use warnings; use Test::More; BEGIN { use_ok('WWW::Shorten::TinyURL') or BAIL_OUT("Can't use module"); } can_ok('WWW::Shorten::TinyURL', qw(makealongerlink makeashorterlink)); can_ok('main', qw(makealongerlink makeashorterlink)); done_testing(); 00load_b.t100755001750001750 30014022724551 17047 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/tuse strict; use warnings; use Test::More; BEGIN { use_ok('WWW::Shorten', 'TinyURL') or BAIL_OUT("Can't use module"); } can_ok('main', qw(makealongerlink makeashorterlink)); done_testing(); 93-dead-masl.t100755001750001750 36314022724551 17560 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/tuse strict; use warnings; use Test::More; use Try::Tiny qw(try catch); my $res = try {require WWW::Shorten::MakeAShorterLink; '' } catch { "inactive service $_" }; like($res, qr/inactive/, "::MakeAShorterLink is inactive"); done_testing(); 97-dead-qurl.t100755001750001750 33314022724551 17610 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/tuse strict; use warnings; use Test::More; use Try::Tiny qw(try catch); my $res = try {require WWW::Shorten::Qurl; '' } catch { "inactive service $_" }; like($res, qr/inactive/, "::Qurl is inactive"); done_testing(); 98-dead-qwer.t100755001750001750 33314022724551 17604 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/tuse strict; use warnings; use Test::More; use Try::Tiny qw(try catch); my $res = try {require WWW::Shorten::Qwer; '' } catch { "inactive service $_" }; like($res, qr/inactive/, "::Qwer is inactive"); done_testing(); 00-load-short.t100755001750001750 33214022724551 17765 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/tuse strict; use warnings; use Try::Tiny qw(try catch); use Test::More; BEGIN { use_ok('WWW::Shorten','TinyURL', ':short') or BAIL_OUT("Can't use module"); } can_ok('main', qw(short_link long_link)); done_testing(); 96-dead-linkz.t100755001750001750 33514022724551 17755 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/tuse strict; use warnings; use Test::More; use Try::Tiny qw(try catch); my $res = try {require WWW::Shorten::Linkz; '' } catch { "inactive service $_" }; like($res, qr/inactive/, "::Linkz is inactive"); done_testing(); WWW000755001750001750 014022724551 16155 5ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/libShorten.pm100755001750001750 764214022724551 20311 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/lib/WWWpackage WWW::Shorten; use 5.008001; use strict; use warnings; use base qw(WWW::Shorten::generic); use Carp (); our $DEFAULT_SERVICE = 'TinyURL'; our @EXPORT = qw(makeashorterlink makealongerlink); our $VERSION = '3.094'; my $style; sub import { my $class = shift; $style = shift; $style = $DEFAULT_SERVICE unless defined $style; my $package = "${class}::${style}"; eval { my $file = $package; $file =~ s/::/\//g; require "$file.pm"; }; Carp::croak($@) if $@; $package->import(@_); } 1; =head1 NAME WWW::Shorten - Interface to URL shortening sites. =head1 SYNOPSIS #!/usr/bin/env perl use strict; use warnings; use WWW::Shorten 'TinyURL'; # Recommended # use WWW::Shorten 'Bitly'; # or one of the others # Individual modules have have their own syntactic variations. # See the documentation for the particular module you intend to use for details my $url = 'https://metacpan.org/pod/WWW::Shorten'; my $short_url = makeashorterlink($url); my $long_url = makealongerlink($short_url); # - OR - # If you don't like the long function names: use WWW::Shorten 'TinyURL', ':short'; my $short_url = short_link($url); my $long_url = long_link( $short_url ); =head1 DESCRIPTION A Perl interface to various services that shorten URLs. These sites maintain databases of long URLs, each of which has a unique identifier. =head1 DEPRECATION NOTICE The following shorten services have been deprecated as the endpoints no longer exist or function: =over =item * L =item * L =item * L =item * L =item * L =item * L =item * L =item * L =back When version C<3.100> is released, these deprecated services will not be part of the distribution. =head1 SHORTEN APP A very simple program called F is supplied in the distribution's F folder. This program takes a URL and gives you a shortened version of it. =head1 BUGS, REQUESTS, COMMENTS Please submit any L you might have. We appreciate all help, suggestions, noted problems, and especially patches. * If you know of a shorten service that we don't already have, make your own service and release it as a separate module, like L or L. Alternatively, you can let us know and we'll be happy to work it up for you. =head1 AUTHOR Iain Truskett C =head1 CONTRIBUTORS =over =item * Alex Page -- for the original LWP hacking on which Dave based his code. =item * Ask Bjoern Hansen -- providing L =item * Chase Whitener C =item * Dave Cross dave@perlhacks.com -- Authored L on which this was based =item * Eric Hammond -- writing L =item * Jon and William (wjr) -- smlnk services =item * Kazuhiro Osawa C =item * Kevin Gilbertson (Gilby) -- TinyURL API information =item * Martin Thurn -- bug fixes =item * Matt Felsen (mattf) -- shorter function names =item * Neil Bowers C =item * PJ Goodwin -- code for L =item * Shashank Tripathi C -- for providing L =item * Simon Batistoni -- giving the `makealongerlink` idea to Dave. =item * Everyone else we might have missed. =back In 2004 Dave Cross took over the maintenance of this distribution following the death of Iain Truskett. In 2016, Chase Whitener took over the maintenance of this distribution. =head1 LICENSE AND COPYRIGHT Copyright (c) 2002 by Iain Truskett. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 SEE ALSO L, L =cut author000755001750001750 014022724551 16660 5ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/xtpod-cm.t100755001750001750 53314022724551 20350 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/xt/author#! perl use strict; use warnings; use Test::More; BEGIN { $] >= 5.010 or plan skip_all => "Test::Pod::Spelling::CommonMistakes requires perl 5.10"; plan skip_all => 'Set AUTHOR_TESTING environmental variable to test this.' unless $ENV{AUTHOR_TESTING}; } use Test::Pod::Spelling::CommonMistakes qw(all_pod_files_ok); all_pod_files_ok(); 1; 00-load-default.t100755001750001750 35014022724551 20252 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/tuse strict; use warnings; use Try::Tiny qw(try catch); use Test::More; BEGIN { use_ok('WWW::Shorten','TinyURL', ':default') or BAIL_OUT("Can't use module"); } can_ok('main', qw(makeashorterlink makealongerlink)); done_testing(); changes.t100755001750001750 42514022724551 20601 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/xt/author#!perl use strict; use warnings; use Test::More; BEGIN { $] >= 5.010 or plan skip_all => "CPAN::Changes requires perl 5.10"; plan skip_all => 'Set AUTHOR_TESTING environmental variable to test this.' unless $ENV{AUTHOR_TESTING}; } use Test::CPAN::Changes; changes_ok(); 92-dead-metamark.t100755001750001750 34314022724551 20422 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/tuse strict; use warnings; use Test::More; use Try::Tiny qw(try catch); my $res = try {require WWW::Shorten::Metamark; '' } catch { "inactive service $_" }; like($res, qr/inactive/, "::Metamark is inactive"); done_testing(); 95-dead-tinylink.t100755001750001750 34314022724551 20465 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/tuse strict; use warnings; use Test::More; use Try::Tiny qw(try catch); my $res = try {require WWW::Shorten::Tinylink; '' } catch { "inactive service $_" }; like($res, qr/inactive/, "::Tinylink is inactive"); done_testing(); kwalitee.t100755001750001750 55514022724551 21002 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/xt/author#!perl ## in a separate test file use strict; use warnings; use Test::More; BEGIN { $] >= 5.010 or plan skip_all => "Test::Kwalitee requires perl 5.10 (at least on AUTHOR's machine ^^)"; plan skip_all => 'Set AUTHOR_TESTING environmental variable to test this.' unless $ENV{AUTHOR_TESTING}; } use Test::Kwalitee 'kwalitee_ok'; kwalitee_ok(); done_testing; manifest.t100755001750001750 43314022724551 20776 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/xt/author#!perl use strict; use warnings; use Test::More; BEGIN { $] >= 5.008 or plan skip_all => "Test::CheckManifest requires perl 5.8"; plan skip_all => 'Set AUTHOR_TESTING environmental variable to test this.' unless $ENV{AUTHOR_TESTING}; } use Test::CheckManifest; ok_manifest(); 94-dead-tinyclick.t100755001750001750 34514022724551 20616 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/tuse strict; use warnings; use Test::More; use Try::Tiny qw(try catch); my $res = try {require WWW::Shorten::TinyClick; '' } catch { "inactive service $_" }; like($res, qr/inactive/, "::TinyClick is inactive"); done_testing(); 00-report-prereqs.t100755001750001750 1345214022724551 20752 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/t#!perl use strict; use warnings; # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.028 use Test::More tests => 1; use ExtUtils::MakeMaker; use File::Spec; # from $version::LAX my $lax_version_re = qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )? | (?:\.[0-9]+) (?:_[0-9]+)? ) | (?: v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )? | (?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)? ) )/x; # hide optional CPAN::Meta modules from prereq scanner # and check if they are available my $cpan_meta = "CPAN::Meta"; my $cpan_meta_pre = "CPAN::Meta::Prereqs"; my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic # Verify requirements? my $DO_VERIFY_PREREQS = 1; sub _max { my $max = shift; $max = ( $_ > $max ) ? $_ : $max for @_; return $max; } sub _merge_prereqs { my ($collector, $prereqs) = @_; # CPAN::Meta::Prereqs object if (ref $collector eq $cpan_meta_pre) { return $collector->with_merged_prereqs( CPAN::Meta::Prereqs->new( $prereqs ) ); } # Raw hashrefs for my $phase ( keys %$prereqs ) { for my $type ( keys %{ $prereqs->{$phase} } ) { for my $module ( keys %{ $prereqs->{$phase}{$type} } ) { $collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module}; } } } return $collector; } my @include = qw( ); my @exclude = qw( ); # Add static prereqs to the included modules list my $static_prereqs = do './t/00-report-prereqs.dd'; # Merge all prereqs (either with ::Prereqs or a hashref) my $full_prereqs = _merge_prereqs( ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ), $static_prereqs ); # Add dynamic prereqs to the included modules list (if we can) my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; my $cpan_meta_error; if ( $source && $HAS_CPAN_META && (my $meta = eval { CPAN::Meta->load_file($source) } ) ) { $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); } else { $cpan_meta_error = $@; # capture error from CPAN::Meta->load_file($source) $source = 'static metadata'; } my @full_reports; my @dep_errors; my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs; # Add static includes into a fake section for my $mod (@include) { $req_hash->{other}{modules}{$mod} = 0; } for my $phase ( qw(configure build test runtime develop other) ) { next unless $req_hash->{$phase}; next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING}); for my $type ( qw(requires recommends suggests conflicts modules) ) { next unless $req_hash->{$phase}{$type}; my $title = ucfirst($phase).' '.ucfirst($type); my @reports = [qw/Module Want Have/]; for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) { next if $mod eq 'perl'; next if grep { $_ eq $mod } @exclude; my $file = $mod; $file =~ s{::}{/}g; $file .= ".pm"; my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; my $want = $req_hash->{$phase}{$type}{$mod}; $want = "undef" unless defined $want; $want = "any" if !$want && $want == 0; my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; if ($prefix) { my $have = MM->parse_version( File::Spec->catfile($prefix, $file) ); $have = "undef" unless defined $have; push @reports, [$mod, $want, $have]; if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) { if ( $have !~ /\A$lax_version_re\z/ ) { push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)"; } elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) { push @dep_errors, "$mod version '$have' is not in required range '$want'"; } } } else { push @reports, [$mod, $want, "missing"]; if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) { push @dep_errors, "$mod is not installed ($req_string)"; } } } if ( @reports ) { push @full_reports, "=== $title ===\n\n"; my $ml = _max( map { length $_->[0] } @reports ); my $wl = _max( map { length $_->[1] } @reports ); my $hl = _max( map { length $_->[2] } @reports ); if ($type eq 'modules') { splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports; } else { splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports; } push @full_reports, "\n"; } } } if ( @full_reports ) { diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports; } if ( $cpan_meta_error || @dep_errors ) { diag "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n"; } if ( $cpan_meta_error ) { my ($orig_source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; diag "\nCPAN::Meta->load_file('$orig_source') failed with: $cpan_meta_error\n"; } if ( @dep_errors ) { diag join("\n", "\nThe following REQUIRED prerequisites were not satisfied:\n", @dep_errors, "\n" ); } pass('Reported prereqs'); # vim: ts=4 sts=4 sw=4 et: release000755001750001750 014022724551 16776 5ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/xtkwalitee.t100755001750001750 32114022724551 21107 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/xt/release# this test was generated with Dist::Zilla::Plugin::Test::Kwalitee 2.12 use strict; use warnings; use Test::More 0.88; use Test::Kwalitee 1.21 'kwalitee_ok'; kwalitee_ok( qw( -no_symlinks ) ); done_testing; pod-spell.t100755001750001750 141414022724551 21107 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/xt/authoruse strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::PodSpelling 2.007005 use Test::Spelling 0.12; use Pod::Wordlist; set_spell_cmd('aspell list'); add_stopwords(); all_pod_files_spelling_ok( qw( bin lib ) ); __DATA__ Alexandr Anwar Batistoni Beijen Bjoern CPAN Chase Ciornii Cross Dave Derek Felsen Gilbertson Gilby Iain Kazuhiro Kessel LinkToolbot Linkz MakeAShorterLink Metamark Michiel Mohammad Osawa PJ Qurl Qwer Schachter Schrock Shorten Thurn TinyClick TinyURL Tinylink Tripathi Truskett UserAgent WWW Whitener _dead ambs author bin capoeirab chorny davecross dereks generic github jon lib makealongerlink makeashorterlink manwar mattf merchantability michielb no shashank shorten smlnk spoon stopwords truskett ua wjr wordlist yappo pod-syntax.t100755001750001750 25214022724551 21275 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/xt/author#!perl # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); 00-report-prereqs.dd100755001750001750 466314022724551 21062 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/tdo { my $x = { 'configure' => { 'requires' => { 'ExtUtils::MakeMaker' => '6.52', 'perl' => '5.008' } }, 'develop' => { 'requires' => { 'Dist::Zilla' => '0', 'Dist::Zilla::Plugin::MinimumPerl' => '0', 'Dist::Zilla::PluginBundle::Starter' => 'v4.0.0', 'Pod::Coverage::TrustPod' => '0', 'Test::CPAN::Changes' => '0.4', 'Test::CPAN::Meta' => '0', 'Test::CheckManifest' => '1.29', 'Test::Kwalitee' => '1.22', 'Test::More' => '0.88', 'Test::PAUSE::Permissions' => '0', 'Test::Pod' => '1.41', 'Test::Pod::Coverage' => '1.08', 'Test::Pod::Spelling::CommonMistakes' => '1.000', 'Test::Spelling' => '0.12', 'Test::Version' => '2.00' } }, 'runtime' => { 'requires' => { 'Carp' => '0', 'Getopt::Long' => '2.4', 'LWP::UserAgent' => '5.835', 'Try::Tiny' => '0.24', 'perl' => '5.008', 'strict' => '0', 'warnings' => '0' } }, 'test' => { 'recommends' => { 'CPAN::Meta' => '2.120900' }, 'requires' => { 'ExtUtils::MakeMaker' => '0', 'File::Spec' => '0', 'Test::More' => '0.88', 'perl' => '5.008' } } }; $x; }Shorten000755001750001750 014022724551 17577 5ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/lib/WWWQurl.pm100755001750001750 111614022724551 21222 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/lib/WWW/Shortenpackage WWW::Shorten::Qurl; use strict; use warnings; our $VERSION = '3.094'; require WWW::Shorten::_dead; 0; =head1 NAME WWW::Shorten::Qurl - (DEPRECATED) Shorten URLs =head1 SYNOPSIS # no viable use case =head1 DESCRIPTION This module is deprecated since the service no longer functions. Please see L instead. =head1 AUTHOR Dave Cross C =head1 CONTRIBUTORS =over =item * Chase Whitener C =back =head1 COPYRIGHT AND LICENSE Under the terms and copyright of L =head1 SEE ALSO L =cut Qwer.pm100755001750001750 110714022724551 21215 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/lib/WWW/Shortenpackage WWW::Shorten::Qwer; use strict; use warnings; our $VERSION = '3.094'; require WWW::Shorten::_dead; 0; =head1 NAME WWW::Shorten::Qwer - (DEPRECATED) URL Shorten Service =head1 SYNOPSIS # no viable use case =head1 DESCRIPTION This module is deprecated since the service no longer functions. Please see L instead. =head1 AUTHOR Dave Cross C =head1 CONTRIBUTORS =over =item * Chase Whitener C =back =head1 COPYRIGHT AND LICENSE See the main L docs. =head1 SEE ALSO L =cut 91-dead-linktoolbot.t100755001750001750 35114022724551 21157 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/tuse strict; use warnings; use Test::More; use Try::Tiny qw(try catch); my $res = try {require WWW::Shorten::LinkToolbot; '' } catch { "inactive service $_" }; like($res, qr/inactive/, "::LinkToolbot is inactive"); done_testing(); Linkz.pm100755001750001750 116214022724551 21367 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/lib/WWW/Shortenpackage WWW::Shorten::Linkz; use strict; use warnings; our $VERSION = '3.094'; require WWW::Shorten::_dead; 1; =head1 NAME WWW::Shorten::Linkz - (DEPRECATED) Shorten URLs =head1 SYNOPSIS # No appropriate use case. =head1 DESCRIPTION Unfortunately, this service became inactive. So, this module will merely give you an error if you try to use it. Feel free to pick a different L. =head1 AUTHOR Iain Truskett =head1 CONTRIBUTORS =over =item * Chase Whitener C =item * Dave Cross C =back =head1 SEE ALSO L =cut _dead.pm100755001750001750 136714022724551 21343 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/lib/WWW/Shortenpackage WWW::Shorten::_dead; use strict; use warnings; our $VERSION = '3.094'; die <<'EOF'; This WWW::Shorten service is inactive. Please use a different one. EOF 1; =head1 NAME WWW::Shorten::_dead - Where dead link-shortening services go =head1 SYNOPSIS # just change your service to look like this: package WWW::Shorten::SomeDeadService; use strict; use warnings; our $VERSION = '1.001'; $VERSION = eval $VERSION; # ensure a common error message will be given to the user require WWW::Shorten::_dead; 1; =head1 DESCRIPTION This is just a module that we use for link-shortening services that we used to support but which no longer exist. =head1 AUTHOR Iain Truskett =head1 SEE ALSO L =cut pod-coverage.t100755001750001750 223414022724551 21564 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/xt/author#!perl # This file was automatically generated by Dist::Zilla::Plugin::Test::Pod::Coverage::Configurable 0.07. use Test::Pod::Coverage 1.08; use Test::More 0.88; BEGIN { if ( $] <= 5.008008 ) { plan skip_all => 'These tests require Pod::Coverage::TrustPod, which only works with Perl 5.8.9+'; } } use Pod::Coverage::TrustPod; my %skip = map { $_ => 1 } qw( WWW::Shorten::_dead WWW::Shorten::LinkToolbot WWW::Shorten::Linkz WWW::Shorten::MakeAShorterLink WWW::Shorten::Metamark WWW::Shorten::TinyClick WWW::Shorten::Tinylink WWW::Shorten::Qwer WWW::Shorten::Qurl ); my @modules; for my $module ( all_modules() ) { next if $skip{$module}; push @modules, $module; } plan skip_all => 'All the modules we found were excluded from POD coverage test.' unless @modules; plan tests => scalar @modules; my %trustme = (); my @also_private; for my $module ( sort @modules ) { pod_coverage_ok( $module, { coverage_class => 'Pod::Coverage::TrustPod', also_private => \@also_private, trustme => $trustme{$module} || [], }, "pod coverage for $module" ); } done_testing(); TinyURL.pm100755001750001750 717714022724551 21622 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/lib/WWW/Shortenpackage WWW::Shorten::TinyURL; use strict; use warnings; use Carp (); use base qw( WWW::Shorten::generic Exporter ); our $_error_message = ''; our @EXPORT = qw( makeashorterlink makealongerlink ); our $VERSION = '3.094'; sub makeashorterlink { my $url = shift or Carp::croak('No URL passed to makeashorterlink'); $_error_message = ''; # terrible, bad! skip live testing for now. if ( $ENV{'WWW-SHORTEN-TESTING'} ) { return 'https://tinyurl.com/abc12345' if ( $url eq 'https://metacpan.org/release/WWW-Shorten' ); $_error_message = 'Incorrect URL for testing purposes'; return undef; } # back to normality. my $ua = __PACKAGE__->ua(); my $tinyurl = 'https://tinyurl.com/api-create.php'; my $resp = $ua->post($tinyurl, [url => $url, source => "PerlAPI-$VERSION",]); return undef unless $resp->is_success; my $content = $resp->content; if ($content =~ /Error/) { if ($content =~ / 100) { $_error_message = substr($content, 0, 100); } else { $_error_message = $content; } return undef; } if ($resp->content =~ m!(\Qhttps://tinyurl.com/\E\w+)!x) { return $1; } return; } sub makealongerlink { my $url = shift or Carp::croak('No TinyURL key / URL passed to makealongerlink'); $_error_message = ''; $url = "https://tinyurl.com/$url" unless $url =~ m!^https://!i; # terrible, bad! skip live testing for now. if ( $ENV{'WWW-SHORTEN-TESTING'} ) { return 'https://metacpan.org/release/WWW-Shorten' if ( $url eq 'https://tinyurl.com/abc12345' ); $_error_message = 'Incorrect URL for testing purposes'; return undef; } # back to normality my $ua = __PACKAGE__->ua(); my $resp = $ua->get($url); unless ($resp->is_redirect) { my $content = $resp->content; if ($content =~ /Error/) { if ($content =~ / 100) { $_error_message = substr($content, 0, 100); } else { $_error_message = $content; } } else { $_error_message = 'Unknown error'; } return undef; } my $long = $resp->header('Location'); return $long; } 1; =head1 NAME WWW::Shorten::TinyURL - Perl interface to L =head1 SYNOPSIS use strict; use warnings; use WWW::Shorten::TinyURL; use WWW::Shorten 'TinyURL'; my $short_url = makeashorterlink('https://www.foo.com/some/long/url'); my $long_url = makealongerlink($short_url); =head1 DESCRIPTION A Perl interface to the web site L. The service simply maintains a database of long URLs, each of which has a unique identifier. =head1 Functions =head2 makeashorterlink The function C will call the L web site passing it your long URL and will return the shorter version. =head2 makealongerlink The function C does the reverse. C will accept as an argument either the full URL or just the identifier. If anything goes wrong, then either function will return C. =head2 EXPORT makeashorterlink, makealongerlink =head1 SUPPORT, LICENSE, THANKS and SUCH See the main L docs. =head1 AUTHOR Iain Truskett =head1 SEE ALSO L, L =cut generic.pm100755001750001750 301114022724551 21707 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/lib/WWW/Shortenpackage WWW::Shorten::generic; use strict; use warnings; use Carp (); use WWW::Shorten::UserAgent; our $VERSION = '3.094'; my %name_sets = ( default => [qw( makeashorterlink makealongerlink )], short => [qw( short_link long_link )], ); sub import { my $class = shift; my ($package) = caller; ($package) = caller(1) if $package eq 'WWW::Shorten'; my $set = shift; if (defined $set and $set =~ /^ : (\w+) $/x) { $set = $1; } else { $set = 'default'; } if (exists $name_sets{$set}) { no strict 'refs'; *{"${package}::$name_sets{$set}[0]"} = *{"${class}::$name_sets{default}[0]"}; *{"${package}::$name_sets{$set}[1]"} = *{"${class}::$name_sets{default}[1]"}; } else { Carp::croak("Unknown function set - $set."); } } my $ua; sub ua { my $self = shift; return $ua if defined $ua; my $v = $self->VERSION(); $ua = WWW::Shorten::UserAgent->new( env_proxy => 1, timeout => 30, agent => "$self/$v", requests_redirectable => [], ); return $ua; } 1; =head1 NAME WWW::Shorten::generic - Methods shared across all WWW::Shorten modules =head1 SYNOPSIS use WWW::Shorten 'SomeSubclass'; =head1 DESCRIPTION Contains methods that are shared across all WWW::Shorten implementation modules. =head1 FUNCTIONS =head2 ua Returns the object's LWP::Useragent attribute. Creates a new one if one doesn't already exist. =cut Metamark.pm100755001750001750 135214022724551 22042 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/lib/WWW/Shortenpackage WWW::Shorten::Metamark; use strict; use warnings; our $VERSION = '3.094'; require WWW::Shorten::_dead; 1; =head1 NAME WWW::Shorten::Metamark - (DEPRECATED) Shorten URLs =head1 SYNOPSIS # No appropriate use case =head1 DESCRIPTION Unfortunately, this service became inactive at some point between 1.89 and 1.90, so this module will merely give you an error if you try to use it. Feel free to pick a different L. =head1 AUTHOR Iain Truskett C =head1 CONTRIBUTORS =over =item * Chase Whitener C =item * Dave Cross C =back =head1 COPYRIGHT AND LICENSE Under the terms and copyright of L =head1 SEE ALSO L =cut Tinylink.pm100755001750001750 125214022724551 22101 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/lib/WWW/Shortenpackage WWW::Shorten::Tinylink; use strict; use warnings; our $VERSION = '3.094'; require WWW::Shorten::_dead; 1; =head1 NAME WWW::Shorten::Tinylink - (DEPRECATED) Shorten URLs =head1 SYNOPSIS # No appropriate solution =head1 DESCRIPTION Unfortunately, at some point in the middle of 2008, this service stopped returning usable URLs and therefore this module is now deprecated =head1 AUTHOR Iain Truskett C =head1 CONTRIBUTORS =over =item * Chase Whitener C =item * Dave Cross C =back =head1 COPYRIGHT AND LICENSE Under the terms and copyright of L =head1 SEE ALSO L =cut TinyClick.pm100755001750001750 135514022724551 22175 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/lib/WWW/Shortenpackage WWW::Shorten::TinyClick; use strict; use warnings; our $VERSION = '3.094'; require WWW::Shorten::_dead; 1; =head1 NAME WWW::Shorten::TinyClick - (DEPRECATED) Shorten URLs =head1 SYNOPSIS # No appropriate synopsis. =head1 DESCRIPTION Unfortunately, this service became inactive at some point between 1.89 and 1.90, so this module will merely give you an error if you try to use it. Feel free to pick a different L. =head1 AUTHOR Iain Truskett C =head1 CONTRIBUTORS =over =item * Chase Whitener C =item * Dave Cross C =back =head1 COPYRIGHT AND LICENSE Under the terms and copyright of L =head1 SEE ALSO L =cut UserAgent.pm100755001750001750 311314022724551 22173 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/lib/WWW/Shortenpackage WWW::Shorten::UserAgent; use strict; use warnings; use base 'LWP::UserAgent'; our $VERSION = '3.094'; sub get { my $self = shift; my $resp = $self->SUPER::get(@_); die $resp->status_line if $resp->is_error; return $resp; } sub post { my $self = shift; my $resp = $self->SUPER::post(@_); die $resp->status_line if $resp->is_error; return $resp; } 1; =head1 NAME WWW::Shorten::UserAgent - LWP::UserAgent subclass for WWW::Shorten modules. =head1 SYNOPSIS use strict; use warnings; use WWW::Shorten::UserAgent; use Try::Tiny qw(try catch); my $ua = WWW::Shorten::UserAgent->new; my $resp = try { $ua->get($url); } catch { warn "Uh oh: $_"; return undef; }; =head1 DESCRIPTION Subclass of LWP::UserAgent which works the same way as the superclass except that it throws an exception if the C or C method returns an error. See L for the full documentation. =head1 METHODS =head2 get Makes an HTTP GET request and throws an exception on error. =head2 post Makes an HTTP POST request and throws an exception on error. =head1 AUTHOR Dave Cross =head1 LICENSE AND COPYRIGHT Copyright (c) Magnum Solutions Ltd., 2012. All rights reserved. This module is free software. You can redistribute it and/or modify it under the terms of the Artistic License 2.0. 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. =head1 SEE ALSO L =cut LinkToolbot.pm100755001750001750 136114022724551 22541 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/lib/WWW/Shortenpackage WWW::Shorten::LinkToolbot; use strict; use warnings; our $VERSION = '3.094'; require WWW::Shorten::_dead; 1; =head1 NAME WWW::Shorten::LinkToolbot - (DEPRECATED) Shorten URLs =head1 SYNOPSIS # No appropriate use case. =head1 DESCRIPTION Unfortunately, this service became inactive at some point between 1.89 and 1.90, so this module will merely give you an error if you try to use it. Feel free to pick a different L. =head1 AUTHOR Iain Truskett C =head1 CONTRIBUTORS =over =item * Chase Whitener C =item * Dave Cross C =back =head1 COPYRIGHT AND LICENSE Under the terms and copyright of L =head1 SEE ALSO L =cut pause-permissions.t100755001750001750 45414022724551 22777 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/xt/releaseuse strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::PAUSE::Permissions 0.003 use Test::More; BEGIN { plan skip_all => 'Test::PAUSE::Permissions required for testing pause permissions' if $] < 5.010; } use Test::PAUSE::Permissions; all_permissions_ok(); changes_has_content.t100755001750001750 210114022724551 23315 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/xt/releaseuse Test::More tests => 2; note 'Checking Changes'; my $changes_file = 'Changes'; my $newver = '3.094'; my $trial_token = '-TRIAL'; my $encoding = 'UTF-8'; SKIP: { ok(-e $changes_file, "$changes_file file exists") or skip 'Changes is missing', 1; ok(_get_changes($newver), "$changes_file has content for $newver"); } done_testing; sub _get_changes { my $newver = shift; # parse changelog to find commit message open(my $fh, '<', $changes_file) or die "cannot open $changes_file: $!"; my $changelog = join('', <$fh>); if ($encoding) { require Encode; $changelog = Encode::decode($encoding, $changelog, Encode::FB_CROAK()); } close $fh; my @content = grep { /^$newver(?:$trial_token)?(?:\s+|$)/ ... /^\S/ } # from newver to un-indented split /\n/, $changelog; shift @content; # drop the version line # drop unindented last line and trailing blank lines pop @content while ( @content && $content[-1] =~ /^(?:\S|\s*$)/ ); # return number of non-blank lines return scalar @content; } MakeAShorterLink.pm100755001750001750 137514022724551 23451 0ustar00cwhitenercwhitener000000000000WWW-Shorten-3.094/lib/WWW/Shortenpackage WWW::Shorten::MakeAShorterLink; use strict; use warnings; our $VERSION = '3.094'; require WWW::Shorten::_dead; 1; =head1 NAME WWW::Shorten::MakeAShorterLink - (DEPRECATED) Shorten URLs =head1 SYNOPSIS # No appropriate use case. =head1 DESCRIPTION Unfortunately, this service became inactive at some point between 1.89 and 1.90, so this module will merely give you an error if you try to use it. Feel free to pick a different L. =head1 AUTHOR Iain Truskett C =head1 CONTRIBUTORS =over =item * Chase Whitener C =item * Dave Cross C =back =head1 COPYRIGHT AND LICENSE Under the terms and copyright of L =head1 SEE ALSO L =cut