https://github.com/rocktimsaikia/shorten.py
Shorten multiple URLs in bulk in your terminal using tinyurl.com
https://github.com/rocktimsaikia/shorten.py
tinyurl tinyurl-cli url-shortener
Last synced: 11 months ago
JSON representation
Shorten multiple URLs in bulk in your terminal using tinyurl.com
- Host: GitHub
- URL: https://github.com/rocktimsaikia/shorten.py
- Owner: rocktimsaikia
- Created: 2024-04-23T15:47:33.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-23T16:35:57.000Z (almost 2 years ago)
- Last Synced: 2025-03-18T23:49:29.101Z (11 months ago)
- Topics: tinyurl, tinyurl-cli, url-shortener
- Language: Python
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## `shorten.py`
This python script uses [tinyurl.com](https://tinyurl.com/) to shorten URLs in bulk.
It takes a number of URLs in a text file `long_urls.txt` separated by newlines. It then shortens each URL synchronously and writes to a new csv file `short_urls.csv` with the original URL and the shortened URL mapped to the corresponding columns:
1. `Long URL`
2. `Short URL`
> [!NOTE]
> This csv file can be easily imported into a spreadsheet like Google Sheets or Microsoft Excel for further processing.
### Prerequisites
> [!IMPORTANT]
> It is assumed that you have `python3` installed on your system. `tqdm` is also required to display progress bar on the terminal. You can install it using the following command:
```bash
pip install tqdm
```
### Usage :tada:
```bash
./shorten.py
```