From 79a88546f0392173b64cdea2060b3514a7b8ae65 Mon Sep 17 00:00:00 2001 From: Andrew Flegg Date: Sun, 11 Dec 2016 11:28:20 -0800 Subject: [PATCH] Retrieve the latest magazine cover's thumbnail to use as the cover --- recipes/wired.recipe | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/recipes/wired.recipe b/recipes/wired.recipe index d87b1b9e00..012e1156a4 100644 --- a/recipes/wired.recipe +++ b/recipes/wired.recipe @@ -107,3 +107,12 @@ class WiredDailyNews(BasicNewsRecipe): magazine_year_month = self.get_magazine_year_month('.') return [('Magazine-' + magazine_year_month, articles)] + + def get_cover_url(self): + ''' + get the most recent magazine cover + :return: url + ''' + soup = self.index_to_soup('https://www.wired.com/category/magazine/') + return soup.find(id='mag-card').find('img').get('src') +