diff --git a/recipes/ap.recipe b/recipes/ap.recipe index 6537d649a3..df312a47c6 100644 --- a/recipes/ap.recipe +++ b/recipes/ap.recipe @@ -55,13 +55,15 @@ class AssociatedPress(BasicNewsRecipe): self.log('Processing section:', front, 'at', url) data = self.index_to_soup(url, raw=True) data = json.loads(data) + from pprint import pformat + open('/t/raw', 'wb').write(pformat(data)) cards = data.get('cards', ()) articles = [] for card in cards: for article in card['contents']: url = article['localLinkUrl'] - title = article.get('flattenedFirstWords') + title = article.get('headline', article.get('flattenedFirstWords')) if not title: continue title = title.split('\u2014')[-1]