/url

Do things with the title of a URL.

Primary LanguagePython

URL

Do things with the title of a URL.

Similar to Make a pretty Markdown link!, but a lot faster.

  1. Just get the title by itself.
  2. Make a Markdown link.
  3. Make an HTML link.
  4. Get the title and URL formatted for a Git commit message.

Setup

  1. python3 -m venv .venv
  2. source .venv/bin/activate
  3. pip install -r requirements.txt
  4. deactivate
  5. chmod +x url.py (probably redundant)
  6. Add a symbolic link somewhere on your path.
    • ln -s ~/Code/url/url.py ~/bin/url
  7. Adjust the shebang as needed.

Usage

To get the title of the URL by itself:

$ url https://example.com

Output:

Example Domain

To get a Markdown link:

$ url -m https://example.com

Output:

[Example Domain](https://example.com)

To get an HTML link:

$ url -t https://example.com

Output:

<a href="https://example.com">Example Domain</a>

To get the title and URL formatted for a Git commit message:

$ url -g https://example.com

Output:

Example Domain:
https://example.com