Skip to content

Commit

Permalink
pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Jun 17, 2024
1 parent d10c85b commit a22794e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions recipes/reuters.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ from datetime import datetime, timedelta
from calibre.ebooks.BeautifulSoup import BeautifulSoup
from calibre.web.feeds.news import BasicNewsRecipe


def p_dt(x):
dt = datetime.fromisoformat(x[:-1]) + timedelta(seconds=time.timezone)
return dt.strftime('%b %d, %Y, %I:%M %p')
Expand Down Expand Up @@ -39,7 +40,7 @@ class Reuters(BasicNewsRecipe):
feed_api = index + '/arc/outboundfeeds/v3/mobile/section/{}/?from=0&size=50&outputType=json'
path_api = index + '/arc/outboundfeeds/v3/mobile{}?outputType=json'
sections = [
'world', 'business', 'markets','sustainability', 'legal',
'world', 'business', 'markets','sustainability', 'legal',
'breakingviews', 'technology', 'sports', 'science', 'lifestyle'
]

Expand All @@ -52,7 +53,7 @@ class Reuters(BasicNewsRecipe):
articles = []

data = json.loads(self.index_to_soup(feed_api.format(sec), raw=True))['wireitems']

for x in data:
if x.get('wireitem_type', '') == 'story':
for y in x['templates']:
Expand Down
2 changes: 1 addition & 1 deletion recipes/wsj.recipe
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
import time
from itertools import zip_longest
from datetime import datetime, timedelta
from itertools import zip_longest

from calibre.ebooks.BeautifulSoup import BeautifulSoup
from calibre.web.feeds.news import BasicNewsRecipe, classes
Expand Down

0 comments on commit a22794e

Please sign in to comment.