2021-04-01 22:44:32 +00:00
|
|
|
# Shortener
|
|
|
|
|
2021-04-01 22:49:08 +00:00
|
|
|
This is an small wrapper around the [ethical shortener](https://is.gd/ethics.php) service <https://is.gd>.
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
2022-12-26 22:25:14 +00:00
|
|
|
First install ExoRepo and then run this in a playground:
|
2021-04-01 22:49:08 +00:00
|
|
|
|
|
|
|
```smalltalk
|
2022-12-26 22:25:14 +00:00
|
|
|
ExoRepo new
|
|
|
|
repository: 'https://code.sustrato.red/Offray/Shortener';
|
|
|
|
load.
|
2021-04-01 22:49:08 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
* To shorten a link do:
|
|
|
|
|
|
|
|
`Shortener shorten: 'https://pharo.org'`, which produces something like: `'https://is.gd/cQWvtm'
|
|
|
|
|
|
|
|
* To enlarge a link do:
|
|
|
|
|
2021-04-01 23:05:10 +00:00
|
|
|
`Shortener enlarge: 'https://is.gd/cQWvtm'`, which, conversely, produces `'https://pharo.org'.
|
2021-04-01 22:49:08 +00:00
|
|
|
|
|
|
|
* To shorten a link with an explicit alias do:
|
|
|
|
|
|
|
|
`Shortener shorten: 'https://pharo.org' as: 'pharo'`, which produces `'https://is.gd/pharo'`.
|
|
|
|
|
|
|
|
or will raise an error once a short url have been taken.
|
|
|
|
For example, by running the previous example the alias 'pharo' has been taken for all future
|
|
|
|
short urls and can not be used again (you will need to pick a new short url alias).
|
2022-12-26 22:25:14 +00:00
|
|
|
|
2022-12-26 22:26:36 +00:00
|
|
|
You can also enlarge a link from YouTube using:
|
2022-12-26 22:25:14 +00:00
|
|
|
|
2022-12-26 22:26:36 +00:00
|
|
|
`YouTube enlargeLink: 'https://youtu.be/ggSyF1SVFr4'`
|
2022-12-26 22:25:14 +00:00
|
|
|
|
2022-12-26 22:26:36 +00:00
|
|
|
which produces `https://www.youtube.com/watch?v=ggSyF1SVFr4`.
|
2021-04-01 22:49:08 +00:00
|
|
|
|
|
|
|
Migrated from: <http://static.smalltalkhub.com/Offray/Shortener/index.html>
|