View Single Post
Old 10-02-2022, 12:31 PM   #1
goatnix
Junior Member
goatnix doesn't littergoatnix doesn't litter
 
Posts: 3
Karma: 158
Join Date: Oct 2022
Device: Kobo Sage
Guardian/Observer with cover

Hello, I added the following to the Guardian/Observer recipe so it would download the appropriate cover:
Code:
def get_cover_url(self):
        from datetime import date
        coverdate = date.today()
        if coverdate.weekday() == 6:
            cover = (
                    'https://www.thepaperboy.com/frontpages/archive/The_Observer_' 
                    + str(coverdate.day) + '_' + str(coverdate.month) + '_' 
                    + str(coverdate.year) + '_400.jpg')
        else:
            cover = (
                    'https://www.thepaperboy.com/frontpages/archive/The_Guardian_' 
                    + str(coverdate.day) + '_' + str(coverdate.month) + '_' 
                    + str(coverdate.year) + '_400.jpg')

        return cover
Thought I'd share in case anyone else wanted this
goatnix is offline   Reply With Quote