- Add
gem 'yourls-shortener'
to your Gemfile andbundle install
. - Put the yourls.yml file in your config directory.
- Put the yourls.rb file in your config/initializers directory.
For a shortened URL:
Yourls::Shorten.url("https://urltoshorten.com")
To expand an already shortened URL:
Yourls::Expand.url("https://shortu.rl")
For a click count on a shortened URL:
Yourls::Clicks.url("https://shortu.rl")