Giter VIP home page Giter VIP logo

www-nanoref's Introduction

NAME
     WWW::NanoRef - Shorten URLs via nanoref.com

SYNOPSIS
     use WWW::NanoRef;

     my $ref = WWW::NanoRef->new({ url => $destination_url });

     my $short_url = $ref->get_short_url;

     # or

     my $url = $ref->get_subdomain_url('test');

DESCRIPTION
     This module uses the API published by nanoref.com to produce
     shortened URLs.  So a destination URL like

        http://maps.yahoo.com/dd_result?newaddr=865+W+El+C
        amino+Real&taddr=2495+S+Delaware+St&csz=Sunnyvale%
        2C+CA+94086&country=us&tcsz=San+Mateo%2C+CA+94403-
        1902&tcountry=us

     becomes a shorter URL like

        http://nanoref.com/yahoo/_QhGlg

     or a short URL like this that you choose yourself:

        http://mymap.nanoref.com/

METHODS
  new(\%params)
     Creates a new object.  The only key/value pair required is url,
     which is the destination URL you want the shortened URL to
     redirect to.

   Parameters:
    url
         The destination URL you want the shortened URL to redirect to.

    passwd
         The password you want to associated with the nanoref.com URL for
         viewing stats (see http://nanoref.com/ for details) when they
         are implemented.

    test
         If set to a true value, a nanoref.com URL will be generated, but
         will not be stored (and will not work).  It is used for testing
         this module.

  get_short_url()
     Returns a shortened URL that will redirect to the destination
     URL passed to new() when creating the object.  On error, undef
     is returned.

  get_subdomain_url($subdomain)
     Attempts to register a shortened URL with the given subdomain.  E.g.,

         my $short_url = $nano_ref->get_subdomain_url('test');

     If 'test' has not already been registered, then
     http://test.nanoref.com/ will now redirect to the URL given to
     new().  Otherwise, $short_url will be undef.  This corresponds
     to the "Choose your own" tab on http://nanoref.com/.

  get_error()
     Returns the error message, if any, from the server.

DEPENDENCIES
     XML::Parser::Wrapper (which in turn depends on XML::Parser)
     LWP

AUTHOR
    Don Owens <[email protected]>

LICENSE AND COPYRIGHT
    Copyright (c) 2005 Don Owens <[email protected]>. All rights reserved.

    This is free software; you can redistribute it and/or modify it under
    the same terms as Perl itself. See perlartistic.

    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 ALSO
     http://nanoref.com/

VERSION
     0.02

www-nanoref's People

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.