URL SHORTENER USING PYTHON
By KOPPADA NAGA LAKSHMI
It's a script that takes a list of URLs as command-line arguments and uses the TinyURL API to generate shortened URLs for each input URL.
-1694685354-1982.png)
Technology Used:
The code uses Python for scripting and URL manipulation.
It utilizes the TinyURL API to create shortened URLs, which is a web service.
The code supports different Python versions by using conditional imports.
Working Process:
It executes the script from the command line via passing a list of URLs as arguments. Where it calls the main function to process each input URL.
To generate URLs used a service and TinyURLs are generated for each input URL and printed to the console. For that defined a make_tiny function to generate TinyURLs.
It constructs a request URL to the TinyURL API with the input URL as a query parameter.
So for each URL, call the make_tiny function to generate a TinyURL.There by prints the TinyURL to the console.
If you click the generated link you see the same output as the original URL shows.
Output:
The script's output consists of the shortened TinyURLs corresponding to the input URLs.
Users can use these TinyURLs to share more concise links to the original URLs.
Comments