Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ozh/yourls-bash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

3 Commits

Repository files navigation

A simple bash script to shorten URLs with YOURLS

image

Installation

# using wget
$> wget -q https://raw.githubusercontent.com/ozh/yourls-bash/master/yourls
# using curl
$> curl -s -o yourls https://raw.githubusercontent.com/ozh/yourls-bash/master/yourls

Then, edit the two parameters at the beginning of the script (YOURLS_HOST and YOURLS_KEY) to match your setup.

Depending on your setup, you may want to make this file executable (chmod +x yourls) and in your $PATH (eg ~/bin maybe)

Usage

Shorten a long URL :

$> yourls https://someverylongdomain.com
https://sho.rt/ef

Shorten a long URL and provide a custom keyword and a custom title :

$> yourls https://someverylongurl.com -k test12 --title "Some title"
https://sho.rt/test12

Shorten a URL and receive JSON output, for instance to display with jq :

$> yourls https://example.com -f json | jq
{
 "url": {
 "keyword": "Nzs",
 "url": "https://example.com",
 "title": "Example Domain",
 "date": "2021年06月06日 16:03:44",
 "ip": "127.0.0.1"
 },
 "status": "success",
 "message": "http://example.com added to database",
 "title": "Example Domain",
 "shorturl": "http://sho.rt/Nzs",
 "statusCode": 200
}

Display help message :

$> yourls --help

License

Do whatever the hell you want with it

About

Simple bash script to shorten URLs with YOURLS

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /