Metadata-Version: 2.4
Name: lain_shorten
Version: 1.12
Summary: URL Shortener using s.lain.la API.
Home-page: https://github.com/NecRaul/lain.la-link-shortener
Author: NecRaul
Author-email: NecRaul <necraul@kuroneko.dev>
License-Expression: LGPL-2.1-only
Project-URL: Homepage, https://github.com/NecRaul/lain.la-link-shortener
Project-URL: Documentation, https://github.com/NecRaul/lain.la-link-shortener#readme
Project-URL: Repository, https://github.com/NecRaul/lain.la-link-shortener
Project-URL: Issues, https://github.com/NecRaul/lain.la-link-shortener/issues
Keywords: python,link shortener,shortener,lain,lain.la,s.lain.la,kuroneko
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Internet :: WWW/HTTP
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pyperclip>=1.8.2
Requires-Dist: requests>=2.31.0
Requires-Dist: urllib3>=2.5.0
Dynamic: author
Dynamic: home-page
Dynamic: license-file

# lain.la-link-shortener

URL Shortener using s.lain.la API.

## Requirements

`requests` is used to send the API request.

`pyperclip` is used to copy the link to the clipboard.

If you want to build this on your own, you can install the requirements with

```Python
pip install -r requirements.txt
```

or install the package by running

```Python
pip install lain-shorten
```

Python's native `re` (used to check validity of the url), `argparse` (parse return request and set command argument) and `setuptools` (used to build the script) packages are also used.

## How it works

`s.lain.la` can shorten URLs using curl. I tend to forget the curl syntax and arguments quite easily, so I made a Python package to streamline things. Below is the aforementioned curl command.

```curl
curl -X POST -d 'url=https://yoururlhere.com' https://s.lain.la
```

I just wrapped it inside Python and added validation to check for links and copied the return address to clipboard for ease of use.

You can run the script with

```Python
lain-shorten <your-url-here>
```

I added support for links not starting with http/https as well.
