All Projects → vityafx → urlshortener-rs

vityafx / urlshortener-rs

Licence: MIT License
A very-very simple url shortener for Rust

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to urlshortener-rs

gShort
URL Shortener without all the crap
Stars: ✭ 80 (+135.29%)
Mutual labels:  urlshortener, shortener, bitly, shorten-urls
ruby-bitly
A simple bit.ly ruby client to shorten URLs, expand or get number of clicks on a bitlink.
Stars: ✭ 17 (-50%)
Mutual labels:  shortener, bitly, shorten-urls
bifrost
🌉 The rainbow bridge. URL shortener for Vercel.
Stars: ✭ 28 (-17.65%)
Mutual labels:  url, shortener, shorten-urls
YOURLS
🔗 The de facto standard self hosted URL shortener in PHP
Stars: ✭ 9,007 (+26391.18%)
Mutual labels:  shortener, bitly, shorten-urls
ursho
URL Shortener Service in Go
Stars: ✭ 118 (+247.06%)
Mutual labels:  shortener, shorten-urls
Kutt
Free Modern URL Shortener.
Stars: ✭ 5,480 (+16017.65%)
Mutual labels:  urlshortener, shorten-urls
Breviare
Small URL shortener made with the MERN Stack
Stars: ✭ 16 (-52.94%)
Mutual labels:  url, urlshortener
kzilla.xyz
Shorten the URL. Broaden the reach.
Stars: ✭ 34 (+0%)
Mutual labels:  url, bitly
bitly-vuejs
An URL shortener made with Bitly API, VueJS and ChuckCSS
Stars: ✭ 23 (-32.35%)
Mutual labels:  bitly, shorten-urls
urlzap
⚡️ Your own static URL shortener
Stars: ✭ 57 (+67.65%)
Mutual labels:  shortener, shorten-urls
small-sh
Um encurtador de URL's gratuito e Open source. Torne suas URL's um tanto pequenas forma rápida e gratuita
Stars: ✭ 30 (-11.76%)
Mutual labels:  shortener, shorten-urls
yii2-minify-url
Project on YII2 framework for create short url (url shortener)
Stars: ✭ 15 (-55.88%)
Mutual labels:  urlshortener, shortener
go-fsimpl
Go io/fs.FS filesystem implementations for various URL schemes
Stars: ✭ 225 (+561.76%)
Mutual labels:  url
http
Aplus Framework HTTP Library
Stars: ✭ 113 (+232.35%)
Mutual labels:  url
short
URL shortening service. 高性能短链接服务。
Stars: ✭ 14 (-58.82%)
Mutual labels:  url
web-clipper
Easily download the main content of a web page in html, markdown, and/or epub format from command line.
Stars: ✭ 15 (-55.88%)
Mutual labels:  url
cyber-matrix-ai
Collection of cyber security and "AI" relevant topics
Stars: ✭ 69 (+102.94%)
Mutual labels:  url
dwarf
A O(1) URL shortener microservice backed by redis and gRPC communication.
Stars: ✭ 33 (-2.94%)
Mutual labels:  shortener
1y
A template project to build a short URL manager with Eleventy
Stars: ✭ 68 (+100%)
Mutual labels:  shorten-urls
uri-query-parser
a parser and a builder to work with URI query string the right way in PHP
Stars: ✭ 38 (+11.76%)
Mutual labels:  url

urlshortener-rs

Crates badge CI MIT licensed

A very simple urlshortener for Rust.

This library aims to implement as much URL shortener services as possible and to provide an interface as minimal and simple as possible. For easing pain with dependency hell, the library provides request objects since 0.9.0 version which can be used for performing requests via user http-client library.

Implementations

Currently the following URL shorteners are implemented:

With authentication:

  • goo.gl
  • bit.ly
  • kutt.it (supports self hosting)

Without authentication:

  • bn.gy
  • is.gd
  • v.gd
  • bam.bz
  • fifo.cc
  • tiny.ph
  • tny.im
  • s.coop
  • bmeo.org
  • hmm.rs
  • url-shortener.io

The following services are supported, but are discouraged from use, due to restrictions such as rate limits:

  • tinyurl.com
  • psbe.co
  • rlu.ru
  • sirbz.com
  • hec.su
  • abv8.me
  • nowlinks.net

Usage without "client" feature

You can make a Request object without "client" feature only via provider functions:

extern crate urlshortener;

use urlshortener::providers::{Provider, self};

fn main() {
    let long_url = "https://google.com";
    let key = "MY_API_KEY";
    let req = providers::request(long_url, &Provider::GooGl { api_key: key.to_owned() });
    println!("A request object for shortening URL via GooGl: {:?}", req);
}

Usage with "client" feature

Without authentication

extern crate urlshortener;

use urlshortener::client::UrlShortener;

fn main() {
    let us = UrlShortener::new().unwrap();
    let long_url = "https://google.com";
    println!("Short url for google: {:?}", us.try_generate(long_url, None));
}

With authentication (Goo.Gl)

extern crate urlshortener;

use urlshortener::{ client::UrlShortener, providers::Provider };

fn main() {
    let us = UrlShortener::new().unwrap();
    let long_url = "https://google.com";
    let key = "MY_API_KEY";
    println!("Short url for google: {:?}", us.generate(long_url, Provider::GooGl { api_key: key.to_owned() }));
}

Combined (Goo.Gl + Is.Gd)

extern crate urlshortener;

use urlshortener::{ client::UrlShortener, providers::Provider };

fn main() {    
    let us = UrlShortener::new().unwrap();
    let providers = vec![
        Provider::GooGl { api_key: "MY_API_KEY".to_owned() },
        Provider::IsGd,
    ];
    let long_url = "https://rust-lang.org";
    println!("Short url for google: {:?}", us.try_generate(long_url, Some(providers)));
}

License

This project is licensed under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].