Skip to content

Commit

Permalink
linting corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
zsoltika committed Jun 11, 2024
1 parent de9b389 commit a5ae79a
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions o2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ def main():
"""
This is the business part.
"""
token = open('API.key', 'r', encoding='utf-8').read().strip()
with open('API.key', 'r', encoding='utf-8') as k:
token = k.read().strip()

logger.debug("API key found")

book = mkepub.Book(title='OmniVore saved articles')
Expand All @@ -48,14 +50,15 @@ def main():
if article['article']['article']['isArchived'] is False:

content = ''
clabel = ''
title = article['article']['article']['title'].replace('&','&')
aid = article['article']['article']['id']
url = article['article']['article']['url']
author = article['article']['article']['author']
labels = article['article']['article']['labels']
if not author: author = "No author"
if not title: author = "No title"
if not url: author = "No URL"
if not author:
author = "No author"
if not title:
title += "No title"

logger.debug("Title: " + title)
logger.debug("ID: " + aid)
Expand All @@ -69,8 +72,8 @@ def main():
if title:
content += '<h2>' + title + '</h2>'

if url:
content += '<h6>' + url + '</h6>'
if article['article']['article']['url']:
content += '<h6>' + article['article']['article']['url'] + '</h6>'

if clabel:
content += '<h6>' + clabel + '</h6>'
Expand Down

0 comments on commit a5ae79a

Please sign in to comment.