Skip to content
/ shurly Public

A URL shortening service implemented as a Drupal module

Notifications You must be signed in to change notification settings

rmiddle/shurly

Repository files navigation

// $Id$

ShURLy is a URL shortening service implemented as a module for Drupal. This module was written by Jeff Robbins for Lullabot's "lbt.me" shortening service at http://lbt.me

http://www.youtube.com/watch?v=Qo7qoonzTCE

New URLs are created by going to /shurly and entering the long URL and an optional custom short URL. Short URLs have ownership and each user can track click statistics for his/her URLs.

To maximize the use of characters, URLs are case sensitive. With the correct permissions, short URLs can either be entered custom or autogenerated. Autogenerated URLs use the character set of A-Z, a-z, 0-9. However the characters "01lIO" are not used since these characters are often ambiguous, particularly in print (thanks to Tantek ‚elik for this suggestion). Custom URLs may contain any non-reserved characters including UTF8 characters, glyphs, and icons. How fun is that!?

Views: ----------------------------
ShURLy is completely integrated with the Views module and ShURLy links can be listed/sorted/displayed using Views. Views is a dependency of this module since all listings are created using Views, including the administrative page at admin/build/shurly. Views also provides a page at /myurls where users with "View own URL stats" can see & sort their URLs.

Views integration also means that you could create new pages/blocks with listings like "most popular URLs", "users with most popular URLs", "most recent URLs", "most recently clicked URLs", or a tab on a user's page to show others their most recent URLs, and that sort of thing.

Blocks: ---------------------------
- Create a short URL
    the form to create a URL
- ShURLy bookmarklet
    A block containing a "drag to your bookmarks bar" link. Clicking this
    bookmarklet when on a page bring the user to the the URL shortening 
    site with the URL field filled in for that page.
- My URLs
    This block is created by Views and is basically just a mirror the
    /myurls page. However, by putting this content into a block, you can
    put it into the 'content bottom' region on the /shurly page and get
    a single page with both the entry form and the URL listing

USAGE: ----------------------------
1) Visit admin/user/permissions to set up permissions for Shurly (see explanation of permissions below).
2) To create a new short URL, visit /shurly or add the "Create a short URL" block to your site.
3) To view your own URLs, visit /myurls or add the 'My URLs'

Since short URLs are created at the root path of the site (http://example.com/myURL), it is recommended that this module be used as the basis for a complete site, not as an add-on to an existing site. That being said, the module does its best to ensure that entered URLs don't conflict with existing menu entries and path aliases in the current Drupal installation. ShURLy should work even if Drupal is installed in a subdirectory or without clean URLs.

Permissions: ----------------------
- Create short URLs:
    Allow users in this role to create URLs. This permission also allows users to delete URLs which they have created.
- Enter custom URLs:
    Allow users in this role to enter their own short URLs,
    without this permission all URLs will be autogenerated
- View own URL stats:
    Allow users to view the "My URLs" page (at /myurls)
- Delete own URLs:
    Users may 'delete' URLs which they have created. For security reasons, 
    these URLs are actually only deactivated. They still exist in the
    database and new URLs are not allowed to be created with the same
    short URL path.
- Administer short URLs
    This permission allows users to edit/delete/view all short URLs by 
    all users. This is the administrative permission and should be 
    used carefully

About

A URL shortening service implemented as a Drupal module

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published