You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
URL shortening is a technique on the World Wide Web in which a URL may be made substantially shorter and still direct to the required page. This is achieved by using a redirect which links to the web page that has a long URL.
8
+
9
+
### How it is done?
10
+
11
+
This is achieved by using a redirect which links to the web page that has a long URL.
12
+
In this program the long URL is taken as input and is shortened by using tinyurl API.
13
+
# In make_tiny(url) function encoding of url and appending it to API is done and then we open request_url using urlopen. Then we convert the response to UTF-8, since urlopen() returns a stream of bytes rather than a string.
14
+
15
+
16
+
## Library imported :
17
+
18
+
__future__ ~ is a pseudo-module which programmers can use to enable new language features which are not compatible with the current interpreter.
19
+
contextlib ~ defines ContextManager class whose object properly manages the resources within a program. The file object supports ContextManager API.
20
+
urlib ~ It is a package that collects several modules for working with URLs
21
+
sys ~ provides various functions and variables that are used to manipulate different parts of the Python runtime environment.
0 commit comments