Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/threestage/yourls
An API wrapper for the Yourls open-source URL shortener
https://github.com/threestage/yourls
Last synced: 2 months ago
JSON representation
An API wrapper for the Yourls open-source URL shortener
- Host: GitHub
- URL: https://github.com/threestage/yourls
- Owner: threestage
- License: mit
- Created: 2010-10-19T18:04:11.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2011-08-18T07:14:50.000Z (over 13 years ago)
- Last Synced: 2024-08-02T06:19:32.344Z (5 months ago)
- Language: Ruby
- Homepage:
- Size: 438 KB
- Stars: 12
- Watchers: 2
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.markdown
- License: MIT-LICENSE
Awesome Lists containing this project
- awesome - Ruby - A Ruby wrapper for the YOURLS API. (Integrations / 3rd party Integrations and Frameworks)
README
# Yourls
[YOURLS](http://yourls.org) 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) 2010 [Three Stage Media, Inc.](http://www.threestage.com) and licensed under the MIT License (see MIT-LICENSE for details).