shorturl
Version, currently 0.2.14 versions
- 0.2.1latestJun 22, 2018
- 0.2.0not indexedJan 2, 2020
- 0.1.1not indexedJan 2, 2020
- 0.1.0not indexedJan 2, 2020
github.com/veelenga/shorturl.cr
A tiny library to use URL shortening services
14 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
shorturl:
github: veelenga/shorturl.cr
version: ~> 0.2.1Then run:
shards installshard.yml
- Crystal
- no constraint declared
- Author
- Vitalii Elenhaupt <velenhaupt@gmail.com>
Dependencies
Development Dependencies
- ameba0.7.0github: veelenga/amebadev
- webmock*github: manastech/webmock.crdev
README
# shorturl.cr [](https://travis-ci.org/veelenga/shorturl.cr)
A simple library to use URL shortening services. Inspired by Robby Russell's [shorturl](https://github.com/robbyrussell/shorturl).
## Installation
As a dependency in `shards.yml`:
```yaml
dependencies:
shorturl:
github: veelenga/shorturl.cr
branch: master
```
## Usage
As easy as it could be:
```crystal
require "shorturl"
# shorten
ShortURL.shorten "http://google.com" # => "http://tinyurl.com/2tx"
ShortURL.shorten "http://google.com", :tinyurl # => "http://tinyurl.com/2tx"
ShortURL.shorten "http://google.com", :isgd # => "http://is.gd/OwycZW"
# expand
ShortURL.expand "http://tinyurl.com/2tx" # => "http://google.com"
```
## Binary
As an addition, `shorturl` binary available for you:
```sh
$ crystal build bin/shorturl && ./shorturl -h
Usage: shorturl [arguments]
-u URL, --url=URL URL to be shortened
-s SERVICE, --service=SERVICE Shortening service
-V, --verbose Verbose output
-v, --version Version
-h, --help Prints this help
$ ./shorturl http://google.com
http://tinyurl.com/2tx
```
## Available services
Here is a list of available shortening services in shorturl.cr:
* [is.gd](http://is.gd)
* [shorl.com](http://shorl.com)
* [tinyurl.com](http://tinyurl.com)
* [v.gd](http://v.gd)
## Contributing
1. Fork it
1. Create your feature branch
1. Implement your feature
1. Run tests with `crystal spec`
1. Commit your changes
1. Push to the branch
1. Create a new Pull Request
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.2.1- Tagged
- Jun 22, 2018
- Commit
c5fb17df70ae- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/veelenga/shorturl.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 13, 2026
- Synced
- Aug 13, 2026
- Versions
- 4