-
Notifications
You must be signed in to change notification settings - Fork 0
Usage
TheOctoGirl edited this page Oct 28, 2023
·
3 revisions
To shorten a URL you can use the link.shorten()
function to shorten a URL.
from pygdshort import link
short_url = link.shorten(long_url = "https://example.com")
Optionally you can also add the custom_short_url parameter to the link.shorten()
function to generate a custom short URL.
from pygdshort import link
short_url = link.shorten(long_url = "https://example.com", custom_short_url = "example")
When link.shorten()
is run it will return the shortened URL in a string.
To expand a URL you can use the link.expand()
function to expand a URL to its original URL.
from pygdshort import link
long_link = link.expand(short_url = "https://is.gd/example")
When link.expand()
is run it will return the expanded URL in a string.