Skip to content

Conversation

@DanielePalombo
Copy link

=== Shorten without generating new short URL (if exists long_url in history)
client = Googl.client('[email protected]', 'my_valid_password')
url = client.shorten('https://github.com/zigotto/googl')
url.short_url
=> http://goo.gl/DWDfi

url = client.shorten('https://github.com/zigotto/googl')
url.short_url
=> http://goo.gl/Oh48S

url = client.shorten('https://github.com/zigotto/googl', unique: true)
url.short_url
=> http://goo.gl/Oh48S

@johnnyshields
Copy link
Contributor

:unique is a misleading name for this option. I would think that if unique: true we should generate a new (unique) short URL for the input.

I would either do unique: false to use the existing, or call it something else like use_existing: true, reuse: true, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants