Metadata-Version: 1.1
Name: Flask-Shorteners
Version: 0.3
Summary: Flask Extension for some popular shorteners
Home-page: https://github.com/ellisonleao/Flask-Shorteners/
Author: Ellison Leão
Author-email: ellisonleao@gmail.com
License: MIT
Description: Flask-Shorteners
        ================
        
        ![Build Status](https://api.travis-ci.org/ellisonleao/Flask-Shorteners.png)
        [![Coverage
        Status](https://coveralls.io/repos/ellisonleao/Flask-Shorteners/badge.png)](https://coveralls.io/r/ellisonleao/Flask-Shorteners)
        
        Flask Extension for some popular shorteners.
        
        ## Usage
        
        Create an Flask application then puth a single engine config. If the
        engine uses an api key and a login, they shall be provided as well
        
        Shorteners implemented so far: 
        
        ## Googl Shortener
        
        No login or api key needed
        
            from flask import Flask
        	from flask.ext.shorteners import Shortener
            	
            app = Flask(__name__)
            app.config['SHORTENER_ENGINE'] = 'GoogleShortener'
        	url = 'http://www.google.com'
        	shortener = Shortener(app)
        	print "My short url is {}".format(shortener.short(url))
        
        	# expanding
        	url = 'http://goo.gl/SsadY'
        	shortener = Shortener(app)
        	print "My long url is {}".format(shortener.expand(url))
        
        
        ## Bit.ly 
        
        API Key and login configs needed	
        
        	from flask import Flask
        	from flask.ext.shorteners import Shortener
        	
        	app = Flask(__name__)
            
            # For Bit.ly you HAVE to pass the login and api key
            app.config['SHORTENER_ENGINE'] = 'BitlyShortener'
            app.config['BITLY_LOGIN'] = 'MY_LOGIN'
            app.config['BITLY_API_KEY'] = 'MY_API_KEY'
        
            url = 'http://www.google.com'
            shortener = Shortener(app)
            print "My short url is {}".format(shortener.short(url))
        
            # expanding
            url = 'http://bit.ly/AvGsb'
            shortener = Shortener(app)
            print "My long url is {}".format(shortener.expand(url))
        
        ## TinyURL Shortener
        
        No login or api key needed
        
            from flask import Flask
        	from flask.ext.shorteners import Shortener
            	
            app = Flask(__name__)
            app.config['SHORTENER_ENGINE'] = 'TinyurlShortener'
        	url = 'http://www.google.com'
        	shortener = Shortener(app)
        	print "My short url is {}".format(shortener.short(url))
        
        	# expanding
        	url = 'http://tinyurl.com/ycus76'
        	shortener = Shortener(app)
        	print "My long url is {}".format(shortener.expand(url))
        
        
        You can see a nice example on [the test
        file](https://github.com/ellisonleao/Flask-Shorteners/blob/master/example.py)
        
Platform: any
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
