Skip to main content

Python Library to help you short urls using advanced options. Multiple domains supported

Project description

advurl_shortner - Advanced URL Shortner for Python

Software License

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.)

Installation

In order install this package, simply run:

pip install advurl_shortner

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

advurl_shortner-1.0.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

advurl_shortner-1.0.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file advurl_shortner-1.0.1.tar.gz.

File metadata

  • Download URL: advurl_shortner-1.0.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.12

File hashes

Hashes for advurl_shortner-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e9f07f3c0e444d24e2e6926ad711046e0870c3d7f80324e28304b9ae4803a1f9
MD5 f7a7d43a4cec41fdc566a329d5011830
BLAKE2b-256 ebdccba97ca2d168af18f525c37265b4231d2fb92579dae39e68eaf77f82b5cd

See more details on using hashes here.

File details

Details for the file advurl_shortner-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for advurl_shortner-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cc55df9d3496462dbff23081da389ed0644720786b9ad7042ab60e3c832ad3ae
MD5 d5a76bee52ab791d2efcbec19b5b3b97
BLAKE2b-256 6f7bd0d7f74b313af6c6a73f9618a57eeccc7c1b3752ac0aa2c5e885fb99513e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page