Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/1marcuth/py.shrtfly
https://github.com/1marcuth/py.shrtfly
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/1marcuth/py.shrtfly
- Owner: 1Marcuth
- License: mit
- Created: 2023-02-27T21:03:44.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-02-28T16:26:47.000Z (over 1 year ago)
- Last Synced: 2024-10-06T12:03:52.871Z (about 1 month ago)
- Language: Python
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Install
**Pypi**
```
pip install shrtfly
```**GitHub**
```
pip install git+https://github.com/1Marcuth/shrtfly-py.git
```# Simple use example
```py
from ShrtFly import ShrtFly, MAINSTREAM, ADULTshortener = ShrtFly("YOUR API TOKEN HERE")
url_info = shortener.shorten(
url="https://1marcuth.github.io/", # URL you want to shorten
alias="url-alias", # URL alias
is_text_format=False, # Whether the result from the server is going to be text
ads_type=MAINSTREAM # Ads type, you can define two types, there is no way to define banner and also you don't need to define if you want url with ads
)url_info.get_raw_data() # Result of all
url_info.get_shortened_url() # Resulting URL
url_info.get_status() # Resulting status ("success" | "error")
url_info.get_message() # Resulting message (if the api sent a message)
```