Beispiel #1
0
def fuck_gpl3():
    url = request.args.get('url')

    if url:
        content = meh(url)
        if content:
            return content, 200, {'Content-Type': 'text/x-markdown; charset=UTF-8'}
        else:
            return '404 Not Found', 404
    else:
        return render_template('index.html')
Beispiel #2
0
    if title:
        title = '# {}'.format(title)
        html = '\n\n'.join([title, html])

    return html2text(html)

def meh(url):
    try:
        content, title = readability(url)
        return convert(content, title=title)
    except KeyError:
        return None


if __name__ == '__main__':
    print meh('http://kennethreitz.org/')
########NEW FILE########
__FILENAME__ = service
# -*- coding: utf-8 -*-

from flask import Flask, request, redirect, url_for, render_template
from converter import meh

app = Flask(__name__)

@app.route('/')
def fuck_gpl3():
    url = request.args.get('url')

    if url:
        content = meh(url)