Python Library to help you short urls using advanced options. Multiple domains supported
Project description
advurl_shortner - Advanced URL Shortner for Python
Python Library to help you short urls with advanced options. Multiple domains, URL TTL, split tests, visit statistics etc. An extended native Python wrapper for AdvUrlShortner API with minimal requirements. Supports all methods and types of responses.
Features
- Easy to use
- Multiple domains
- Link TTL (Time-To-Live) in seconds
- Redirect to second URL after primary URL expires (TTL)
- Randomized and weighted randomnized redirect to different URLs (split tests etc.)
- Password-protected statistics of visits to a shortened URL
- Password protected shortened URL parameters (TTL, second URL, etc.)
Usage
To use shorten_url, you first need to import the package:
import advurl_shortner
Shorten URL:
advurl_shortner.short("https://google.com/")
# Returns the shortened URLs in JSON
# Example: {"urls": ["https://liii.pw/N", "https://illi.ink/N", "https://illi.cfd/N"]}XX
advurl_shortner.short("https://google.com/", password="1234x")
# Returns shortened URLs, sets a password to access visiting statistics and shortened URL parameters.
advurl_shortner.short("https://google.com/", ttl=86400)
# Returns the shortened URLs., after 24 hours (86400 seconds) will return "The Link You Followed Has Expired"
advurl_shortner.short("https://google.com/", ttl=86400, second_url="https://bing.com/")
# Returns the shortened URLs., after 24 hours (86400 seconds) shortned link will redirect to second_url
advurl_shortner.short("https://google.com/",second_url="https://bing.com/")
# Returns shortened URLs. The shortened link is randomly redirected to one of the provided URLs.
advurl_shortner.short("https://google.com/",second_url="https://bing.com/", weights=[0.3, 0.7])
# Returns shortened URLs.
# The shortened link is randomly (weighted by weight parameter) redirected to one of the provided URLs.
# approximately 30% to "https://google.com/ and 70% to "https://bing.com/"
Getting shortned URL parameters and visit statistics:
advurl_shortner.stat("https://illi.cfd/H","aaa")
# Returns the parameters and visit statistics of the shortened URL stored with password "1234x".
# Example:
#{
# "url": "http://google.com/?z=1",
# "second_url": "http://yahoo.com/",
# "ttl": null,
# "date_created": "1703411470",
# "weights": null,
# "visits": 4,
# "primary_url_expired": false
#}
TODO:
- More than 2 URLs
- Advanced visit statistics
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file advurl_shortner-1.0.0.tar.gz.
File metadata
- Download URL: advurl_shortner-1.0.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0cef1c6c4e848f4d790bcedf1b52ec0377d459e18d5cf391467ded4b128180bf
|
|
| MD5 |
75750d6d85cd8593542ee531f81f1c37
|
|
| BLAKE2b-256 |
5b33a449f7fad2ad539d161368c647d38252b2db8c6b9b77a9c1d455594a6b97
|
File details
Details for the file advurl_shortner-1.0.0-py3-none-any.whl.
File metadata
- Download URL: advurl_shortner-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3209c5a0eeffbd20c7973b3978a9713ed01e1ca05419c0c0ea87b48eeeac742f
|
|
| MD5 |
355abb9cd4961ab0b240aa3566c6a3c4
|
|
| BLAKE2b-256 |
8491e48da7c0fde0ecde45c02b7ff54d450e10dccdd865cf19531a53e53b41b5
|