Skip to main content

Unshortens adf.ly, adfoc.us, lnx.lu, linkbucks, and any 301 redirected shortener urls

Project description

Unshortens ad-based urls and 301 redirects. Supports adf.ly, lnx.lu, linkbucks.com, and adfoc.us

Features

  • Supports unshortening the following ad-based shortners:
    • Adf.ly and related subdomains (PyV8 library required)

    • Custom adf.ly domains by passing the type=’adfly’ parameter

    • Lnx.lu

    • Linkbucks.com and related subdomains

    • Adfoc.us

  • Supports any 301 redirected urls

  • Python 2.7 and 3.3 support

Usage

import unshortenit unshortened_uri,status = unshortenit.unshorten(’http://ul.to’)

> unshortenit.unshorten will return a tuple (unshortened_uri,status)

> unshortened_uri will contain the unshortened uri. If you pass in a non-shortener url it will return the original url. > status will contain the status code or any error messages

Installation

pip install unshortenit

In order to enable adf.ly support you will need to install the PyV8 library. This will need to be compiled from source.

#### Python 2.7 PyV8 Instructions:

sudo apt-get install gyp subversion build-essential libboost-python-dev python2.7-dev libboost-system-dev libboost-thread-dev> svn checkout http://v8.googlecode.com/svn/trunk/ v8 svn checkout http://pyv8.googlecode.com/svn/trunk/ pyv8-read-only cd v8 make dependencies cd .. cd pyv8-read-only V8_HOME=/path/to/v8 python2.7 setup.py build * This will not work inside a virtualenv. Make sure to deactivate your virtualenv first. python2.7 setup.py install * You can run this inside your virtualenv to install it.

#### Python 3.3 PyV8 Instructions:

sudo apt-get install gyp subversion build-essential libboost-python-dev python3.3-dev libboost-system-dev libboost-thread-dev svn checkout http://v8.googlecode.com/svn/trunk/ v8 svn checkout http://pyv8.googlecode.com/svn/trunk/ pyv8-read-only cd v8 make dependencies cd .. cd pyv8-read-only sed -i.bak s/'boost_python'/'boost_python-py33'/ setup.py V8_HOME=/path/to/v8 python3.3 setup.py build * This will not work inside a virtualenv. Make sure to deactivate your virtualenv first. python3.3 setup.py install * You can run this inside your virtualenv to install it.

History

0.1.0 (2013-10-08)

  • First release.

0.1.1 (2013-10-11)

  • Added support for custom adf.ly domains via the type=’adfly’ variable.

0.1.2 (2013-10-11)

  • Fixed bug with t.co not working.

0.1.3 (2013-10-11)

  • Added a timeout parameter

0.1.4 (2013-10-12)

  • Added support for p.ost.im.

  • Fixed blocking issue with direct links to file downloads

0.1.5 (2014-02-01)

  • Fixed adfoc.us issues resulting from changes to their site

  • Fixed linkbucks.com issues resulting from changes to their site

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

unshortenit-0.1.5.tar.gz (12.7 kB view details)

Uploaded Source

File details

Details for the file unshortenit-0.1.5.tar.gz.

File metadata

  • Download URL: unshortenit-0.1.5.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for unshortenit-0.1.5.tar.gz
Algorithm Hash digest
SHA256 1fce23159cd029af4183d9a9233a919ee50e747897110c1579ade52ca3bba16f
MD5 47ffe51f67b4a45575a5c3aee3c20842
BLAKE2b-256 b04ca2a0884432ff54ae4a79d72ba2cad9853c0a9af27ea16511c872a3c7fbc4

See more details on using hashes here.

Provenance

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