Pope

The Pope has mandated as canon law that your website — with all it's foreign dilly-hoos in the URL — provide a single authoritative URL to his liking. To govern the implementation of this, he is turning to the people to do as they are notorious for: tattle on each other.

Usage

Pass in a URL, and the Pope will give you the canonical URL, if it is provided.

Pope.canonize 'http://example.com/showArticle.php?_slug=mayan-calendar-inferior-to-gregorian-calendar&tracking-stuff=dillyhoos&language=latin'
# => 'http://www.example.com/2012/12/21/mayan-calendar-inferior-to-gregorian-calendar.html'

Installation

In case you still don't know how to install gems, just do this:

Add this line to your application's Gemfile:

gem 'pope'

And then execute:

$ bundle

Or install it yourself as:

$ gem install pope

Contributing

  1. Fork it, and spoon me
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request