Project

yourls

0.0
No commit activity in last 3 years
No release in over 3 years
Use the Yourls API to shorten or expand URLs
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.1.8
>= 0.6.1
 Project Readme

Yourls

YOURLS is an open-source, PHP url-shortening service.

Installation

gem install yourls

Usage

Create a Yourls client using your hostname and api key as follows:

yourls = Yourls.new(your_hosted_yourls_address, your_hosted_yourls_api_key)

You can then interact with the client to shorten or expand urls or to get statistics about your service:

yourls.shorten('http://www.google.com')
yourls.shorten('http://www.google.com', keyword: 'goog') # Creates a custom keyword url
yourls.expand('goog')
yourls.stats

expand and shorten both will return a Yourls::Url object

url = yourls.shorten('http://www.google.com', keyword: 'goog')
url.short_url #=> "http://your-service/goog"
url.long_url #=> "http://www.google.com"
url.keyword #=> "goog"

Copyright

Copyright (c) 2014 and licensed under the MIT License (see MIT-LICENSE for details).