Skip to main content

A module that provides access to .gd URL Shortener

Project description

Python Module for is.gd - v.gd URL Shortener.

https://circleci.com/gh/torre76/gd_shortener.svg?style=svg

What is this?

GD Shortener allow Python software to access is.gd - v.gd URL shortener service.

Using this module you could shorten an URL to a small one like Twitter does for its link.

This service is provided by is.gd - v.gd and, thru the classes in this module, you could view stats on shortened URLs and obtain reverse lookup on URLs.

Install

To install GD Shortener, run the following command:

pip install gdshortener

Usage

After install, to use GD Shortener is sufficient to import the package, choose the implementing class ISGDShortener or VGDShortener (it maps to is.gd or v.gd) and use the following code:

import gdshortener

s = gdshortener.ISGDShortener()
print s.shorten('http://www.google.com')

If you want statistic usage on a URL use:

print s.shorten(url = 'http://www.google.com', log_stat = True)

If you want a custom URL use:

print s.shorten(url = 'http://www.google.com', custom_url = 'Pippus')

If you want to ignore SSL certificate (for older version of OpenSSL):

print s.shorten(url = 'https://expired.badssl.com', verify_ssl = False)

If you have an already shortened URL and want a reverse lookup:

print s.lookup('http://is.gd/Pippus')

License

GD Shortener is licensed under LGPL. See LICENSE.txt for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gdshortener-1.0.1.tar.gz (5.0 kB view details)

Uploaded Source

File details

Details for the file gdshortener-1.0.1.tar.gz.

File metadata

  • Download URL: gdshortener-1.0.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.1 CPython/3.7.5

File hashes

Hashes for gdshortener-1.0.1.tar.gz
Algorithm Hash digest
SHA256 195f17584dc056053e0ce3c86e96d570284d661280f47c1dc306a7c8e1106a06
MD5 4c89a312314676e2b228f8f5c9e8a638
BLAKE2b-256 34d207e1d4516a6961b94e63dc15614955869062ddb9a3318fce704142458d09

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page