Coder Social home page Coder Social logo

kevinnadar22 / shortzy Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 14.0 38 KB

An Unofficial Python version of Adlinkfly and Alternative Website API wrapper

License: GNU Affero General Public License v3.0

Python 100.00%
droplink earn gplinks url-shortener url-shortener-api

shortzy's Introduction


Logo

Shortzy

A Unofficial Wrapper for Adlinkfly Site and Alternative Sites
· Report Bug / Request Feature · Usage · Reference


Shortzy

An Unofficial Python version of Adlinkfly and Alternative Website API wrapper. Used to Short your long link and let you earn from it.

Installation

Install shortzy with pip

pip install shortzy

To Upgrade

pip install --upgrade shortzy

Usage

from shortzy import Shortzy
import asyncio

shortzy = Shortzy('<YOUR API KEY>')

async def main():
    link = await shortzy.convert('https://example.com/')
    print(link)

asyncio.run(main())
Output: https://droplink.co/mVkra

Available Websites

Available list of Websites
  1. droplink.co
  2. gplinks.in
  3. tnlink.in
  4. za.gl
  5. du-link.in
  6. viplink.in
  7. shorturllink.in
  8. shareus.in
  9. Request For Your Website !

Features

  • Single URL Convert
  • Batch Convert from List
  • Convert from Text

Contributing

Contributions are always welcome!

Reference

Init

from shortzy import Shortzy
import asyncio

shortzy = Shortzy(api_key="Your API Key", base_site="droplink.co") 

# Base site defaults to "droplink.co". You can add your own site here which is alternative to this default site
# Please Refer https://github.com/kevinnadar22/shortzy#available-websites for more information

Convert a single URL

convert(link, alias, silently_fail, quick_link) -> str
Parameter Type Description
link string Required. Long URL Link
alias string Custom alias for the link
silently_fail bool Raise an exception or not if error ocuurs
quick_link bool Returns the quick link

Example:

async def main():
    link = await shortzy.convert('https://www.youtube.com/watch?v=d8RLHL3Lizw')
    print(link)

asyncio.run(main())

## Output: https://droplink.co/Ly4fCxZ
## Quick Link: https://droplink.co/st?api=<YOUR API KEY>&url=https://www.youtube.com/watch?v=d8RLHL3Lizw

Bulk Convert

bulk_convert(urls:list, silently_fail, quick_link:bool=False) -> list
Parameter Type Description
urls list Required. List of URLs to convert

Example:

async def main():
    links = ['https://github.com/', 'https://twitter.com/', 'https://google.com/']
    link = await shortzy.bulk_convert(links)
    print(link)

asyncio.run(main())

## Output: ['https://droplink.co/ihu1e', 'https://droplink.co/AkY2Nt', 'https://droplink.co/mK1eVTV']

Convert from Text

convert_from_text(text:str, silently_fail:bool=True, quick_link:bool=False) -> str
Parameter Type Description
text str Required. Text containing Long URLS to short

Example:

async def main():
    text = """
Unstoppable:-https://www.youtube.com/watch?v=330xlOv8p9M
Night Changes:-https://www.youtube.com/watch?v=syFZfO_wfMQ
"""
    link = await shortzy.convert_from_text(text)
    print(link)

asyncio.run(main())

# Output:
# "Unstoppable:-https://droplink.co/T6jbHlU
# Night Changes:-https://droplink.co/ajIRE"

Get quick link

get_quick_link(link:str)
Parameter Type Description
link str Required. Long Link

Example:

async def main():
    link = "https://www.youtube.com/watch?v=syFZfO_wfMQ"
    quick_link = await shortzy.get_quick_link(link)
    print(quick_link)

asyncio.run(main())

## Quick Link: https://droplink.co/st?api=<YOUR API KEY>&url=https://www.youtube.com/watch?v=syFZfO_wfMQ

Support

For support, email [email protected] or PM Dev

Roadmap

  • Add more integrations

Disclaimer

GNU Affero General Public License v3.0
Licensed under GNU AGPL v3.0. Selling The Codes To Other People For Money Is Strictly Prohibited.

Credits

shortzy's People

Contributors

deepsourcebot avatar kevinnadar22 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.