Project

shortn-url

0.0
No commit activity in last 3 years
No release in over 3 years
shortn-url
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

 Project Readme

Store and retrieve short URLs using the Shortn-url gem

require 'shortn-url'}

snurl = ShortnUrl.new('surl.xml')
snurl.full_url('http://www.wired.com/')
#=> aa

snurl.full_url('http://forrst.com/posts/Ban_IP_addresses_from_Asterisk-XDH')
#=> ae

snurl.short_url('aa')
#=> "http://www.wired.com/"

snurl.short_url('ab') # if a URI doesn't exist it will return an empty string
#=> ""

snurl.short_url('ae')
#=> "http://forrst.com/posts/Ban_IP_addresses_from_Asterisk-XDH"

Note: To create the 'surl.xml' file you can use the short-url-creator gem.

Resources