Skip to content

An easy function to get short URL from tinyurl.com

Notifications You must be signed in to change notification settings

kaisuto/tinyurl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

tinyurl

An easy function to get short URL from tinyurl.com

Requirements

  • Python >= 3.5
  • [aiohttp]
  • [requests]
  • [lxml]

Synchronous Version

from tinyurl import TinyURL

url = 'http://tw.yahoo.com'

tiny = TinyURL()
short_url = tiny.get_tinyurl(url)
print(short_url)

Asynchronous Version

import asyncio
from aiotinyurl import AioTinyURL

url = 'http://tw.yahoo.com'

loop = asyncio.get_event_loop()
tiny = AioTinyURL()
short_url = loop.run_until_complete(tiny.get_tinyurl(url))
print(short_url)
loop.close()

About

An easy function to get short URL from tinyurl.com

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages