Giter VIP home page Giter VIP logo

url02's Introduction

ShortURL 1.0.0

Summary

ShortURL is a very simple library to use URL shortening services.

Installation

ShortURL is available as a gem, installation is just like any other gem: $ gem install shorturl

You can also download the tar.bz2 archive at rubyforge.org/frs/?group_id=732 if you do not want to use the gem.

Supported services

Here is the list of the services supported by ShortURL:

Usage:

call-seq:

require "shorturl"
puts ShortURL.shorten("http://mypage.com")
puts ShortURL.shorten("http://mypage.com", :moourl)

The second parameter represents the service you want to use. These are:

  • :tinyurl

  • :shorl

  • :snipurl

  • :metamark

  • :makeashorterlink

  • :skinnylink

  • :linktrim

  • :shorterlink

  • :minlink

  • :lns

  • :fyad

  • :d62

  • :littlink

  • :clipurl

  • :orz

  • :moourl

  • :urltea

  • :vurl

  • :bitly**

You can use ShortURL.valid_services to obtain a list of the valid services (in case I forget to update the documentation)

Bitly**


Their API changed to require an API key.

Two painfree steps to fix this.

1) Get yours easily right now from:

http://bitly.com/a/your_api_key

2) Save it in ~/.shorturl similar to this YAML template:

— Start of file ~/.shorturl —

---
bitly:
  username: O_adsfasdfasfasfd
  key: R_afasdfasdfasdf

— END of file ~/.shorturl —

You're done!  Have a martini.  Cheers.

Thanks

  • Marcel Molina Jr., Devin Mullins for some ideas

  • imperator from #ruby-lang (I don’t know your real name, sorry) for helping me with creating and uploading a RubyGem

  • Daniel Dipaolo for telling me about ln-s.net and fyad.org

Authors

url02's People

Contributors

postmodern avatar robbyrussell avatar bpaul 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.