theme
This commit is contained in:
@@ -8,7 +8,7 @@ from goose3 import Goose
|
||||
|
||||
cgitb.enable()
|
||||
|
||||
goose = Goose({'enable_image_fetching': True})
|
||||
goose = Goose()
|
||||
|
||||
def fetch_site(url):
|
||||
return goose.extract(url=url)
|
||||
@@ -17,14 +17,11 @@ def format_output(article):
|
||||
with open('template.html', 'r') as f:
|
||||
template = f.read()
|
||||
|
||||
extra = ""
|
||||
if article.top_image:
|
||||
extra += """<img src="{}" />""".format(article.top_image.src)
|
||||
|
||||
return template.format(
|
||||
title=article.title,
|
||||
body=article.cleaned_text,
|
||||
extra=extra)
|
||||
)
|
||||
|
||||
def print_headers():
|
||||
print('Content-Type: text/html; charset=utf8\r\n\r\n')
|
||||
|
||||
Reference in New Issue
Block a user