Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 03-28-2025, 12:42 PM   #1
Glenn680
Enthusiast
Glenn680 began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Jan 2024
Device: Kobo
Update Newspaper Front Cover

Hi, created a simple recipe that would include the newspaper front page each day. However that newspaper front cover is no longer updated daily on the current site. So I found a new site to pull the newspaper cover which is updated daily- but the recipe is not working. Not sure what I'm doing wrong (?)

Previous recipe (worked well):
def get_cover_url(self):
soup = self.index_to_soup('https://www.frontpages.com/star-tribune/')
return 'https://www.frontpages.com' + soup.find('img', attrs={'id':'giornale-img'})['src']

New recipe (not working):
def get_cover_url(self):
soup = self.index_to_soup('https://frontpages.freedomforum.org/newspapers/mn_st-Star_Tribune')
return 'https://frontpages.freedomforum.org' + soup.find('img', attrs={'id':'giornale-img'})['src']

Please let me know how to fix. The new recipe only pulls a generic cover. Thanks.
Glenn680 is offline   Reply With Quote
Old 03-30-2025, 10:16 PM   #2
Glenn680
Enthusiast
Glenn680 began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Jan 2024
Device: Kobo
Re: Update Newspaper Front Cover

Haven't seen any responses, thinking (hoping) this is a simple fix I can make within the recipe. Any thoughts on this? Please let me know, thanks.
Glenn680 is offline   Reply With Quote
Advert
Old 05-14-2025, 09:32 AM   #3
juanferna
Member
juanferna began at the beginning.
 
Posts: 13
Karma: 10
Join Date: May 2025
Device: sony PRS T3
Try this:

def get_cover_url(self):
from calibre import strftime
cover = 'https://d2dr22b2lm4tvw.cloudfront.net/mn_st/' + strftime("%Y-%m-%d") + '/front-page-large.jpg'
return cover
juanferna is offline   Reply With Quote
Old Yesterday, 08:08 AM   #4
Glenn680
Enthusiast
Glenn680 began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Jan 2024
Device: Kobo
Thanks I couldn't get the cover to display from your updated code. Appreciate the effort.

Understanding I can swap out the cover myself in properties post-download, still looking for an automated script that will pull the cover as part of the recipe. Glad to review anyone else's attempts at this - thanks all.
Glenn680 is offline   Reply With Quote
Old Yesterday, 10:16 AM   #5
economicsreader
Junior Member
economicsreader began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jan 2025
Device: Kindle Paperwhite Gen 11
Quote:
Originally Posted by juanferna View Post
Try this:

def get_cover_url(self):
from calibre import strftime
cover = 'https://d2dr22b2lm4tvw.cloudfront.net/mn_st/' + strftime("%Y-%m-%d") + '/front-page-large.jpg'
return cover
Why is this not working for you? I just tested it on a random existing recipe and it works fine.
economicsreader is offline   Reply With Quote
Advert
Old Today, 08:26 AM   #6
Glenn680
Enthusiast
Glenn680 began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Jan 2024
Device: Kobo
This is the full recipe, which continues to pull a generic Calibre cover. Anything I can update to make it work? I'm using the tab key to indent so maybe that's it. Otherwise just pasting in the 'get cover' code as provided. New at building recipes, so likely I'm missing something obvious:
Code:
from calibre.web.feeds.news import BasicNewsRecipe

class AdvancedUserRecipe1706194709(BasicNewsRecipe):
    title          = 'Star Tribune Test'
    oldest_article = 7
    max_articles_per_feed = 100
    auto_cleanup   = True

    feeds          = [
    
        ('Local', 'https://www.startribune.com/local/index.rss2'),
        ('Sports', 'https://www.startribune.com/sports/index.rss2'),
        ('Business', 'https://www.startribune.com/business/index.rss2'),
        ('Politics', 'https://www.startribune.com/politics/index.rss2'),
        ('Opinion', 'https://www.startribune.com/opinion/index.rss2'),
        ('Variety', 'https://www.startribune.com/variety/index.rss2'),
        ('Photography', 'https://www.startribune.com/galleries/index.rss2'),
    ]
    
def get_cover_url(self):
    from calibre import strftime
    cover = 'https://d2dr22b2lm4tvw.cloudfront.net/mn_st/' + strftime("%Y-%m-%d") + '/front-page-large.jpg'
    return cover

Last edited by PeterT; Today at 09:31 AM.
Glenn680 is offline   Reply With Quote
Old Today, 11:26 AM   #7
unkn0wn
Guru
unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.unkn0wn understands the Henderson-Hasselbalch Equation.
 
Posts: 602
Karma: 85520
Join Date: May 2021
Device: kindle
use fetch cover code from zaobao recipe which used frontpages.freedomforum.org
unkn0wn is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre Recipe: Newspaper Front Page Glenn680 Recipes 3 03-05-2024 11:34 AM
PRS-650 using the touchscreen without the front cover. temuchin Sony Reader 4 12-05-2013 11:24 PM
PDF files get the front cover twice bferrin PDF 1 04-20-2012 03:59 AM
Touch Front cover only? rcrh Barnes & Noble NOOK 5 07-23-2011 02:19 AM
Newspaper Update Time? pengrus Amazon Kindle 4 02-27-2009 07:06 AM


All times are GMT -4. The time now is 09:42 PM.


MobileRead.com is a privately owned, operated and funded community.