Do things with the title of a URL.
Similar to Make a pretty Markdown link!, but a lot faster.
- Just get the title by itself.
- Make a Markdown link.
- Make an HTML link.
- Get the title and URL formatted for a Git commit message.
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
deactivate
chmod +x url.py
(probably redundant)- Add a symbolic link somewhere on your path.
ln -s ~/Code/url/url.py ~/bin/url
- Adjust the shebang as needed.
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