Skip to content
✂️ A terminal program that shortens URLs using Bitly.
Rust
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
.travis.yml
Cargo.lock
Cargo.toml
LICENSE
README.md

README.md

bitly.rs

Build Status

This is a small command line program that shortens a URL, using the Bit.ly service.

As one of my first projects written in the Rust programming languages the code in this repository might not be the best in terms of style. Please, feel free to open an issue or a PR to help me improve my code!

Getting started

To use this program, follow these steps:

  1. Clone the repository with
$ git clone git@github.com:feliix42/bitly-rs
  1. Build the project.
$ cd bitly-rs
$ cargo build --release

Of course you can spare the release flag if you want to help me develop this program.

  1. Run it!
$ target/release/bitly https://google.com
Please enter your Bit.ly token:
[enter your token here]
http://bit.ly/1NpyVCz

Note that you will be asked for a Bit.ly access token the first time you run the script. It will be saved to ~/.bitly-rs.

Usage

Use $ bitly [long URL] to shorten any URL that comes to your mind.

Roadmap

  • Basic functionality
  • manage OAuth2 Access Token more elegant
  • take URL as command line argument
  • Error Handling (e.g. no network)
  • Better URL parsing
  • change/remove the saved token
  • Refactoring
  • Documentation

Notice

I am in no way associated with Bitly™, the only reason that this project uses Bitly as shortening service is that it has a nice API that is easy to handle. $other_shortening_service might also do a good job, sure!

License

bitly is available under the MIT license. See the LICENSE file for more info.

You can’t perform that action at this time.