Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 05-19-2019, 10:04 AM   #1
nanami
Member
nanami began at the beginning.
 
Posts: 12
Karma: 10
Join Date: May 2016
Device: none
Toronto Star recipe broken

Hi. The Toronto Star (https://www.thestar.com) recipe is broken.

Can anyone help? I can edit a recipe but that's about it.

Thanks very much.
nanami is offline   Reply With Quote
Old 05-19-2019, 07:47 PM   #2
lui1
Enthusiast
lui1 began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Dec 2017
Location: Los Angeles, CA
Device: Smart Phone
Update for The Toronto Star

This fixes the problem.

Update for The Toronto Star:
Code:
__license__ = 'GPL v3'
__copyright__ = '2009-2013, Darko Miletic <darko.miletic at gmail.com>'
'''
www.thestar.com
'''


def classes(classes):
    q = frozenset(classes.split(' '))
    return dict(attrs={'class': lambda x: x and frozenset(x.split()).intersection(q)})


from calibre.web.feeds.news import BasicNewsRecipe


class TheTorontoStar(BasicNewsRecipe):
    title = 'The Toronto Star'
    __author__ = 'Darko Miletic'
    description = "Thestar.com is Canada's largest online news site. Stay current with our sports, business entertainment news and more from the Toronto Star and thestar.com"  # noqa
    oldest_article = 2
    language = 'en_CA'
    max_articles_per_feed = 100
    no_stylesheets = True
    use_embedded_content = False
    delay = 2
    publisher = 'The Toronto Star'
    encoding = 'utf-8'
    masthead_url = 'http://www.thestar.com/etc/designs/thestar/images/general/logoLrg.png'

    keep_only_tags = [
        classes('article')
    ]
    remove_tags = [
        classes('article-continue-basic-container label-modal-bottom'),
        dict(name='button')
    ]
    remove_tags_after = [
        classes('article-content-container')
    ]

    feeds = [
        (u'News', u'http://www.thestar.com/feeds.articles.news.rss'),
        (u'Opinion', u'http://www.thestar.com/feeds.articles.opinion.rss'),
        (u'Business', u'http://www.thestar.com/feeds.articles.business.rss'),
        (u'Sports', u'http://www.thestar.com/feeds.articles.sports.rss'),
        (u'Entertainment', u'http://www.thestar.com/feeds.articles.entertainment.rss'),
        (u'Living', u'http://www.thestar.com/feeds.articles.life.rss'),
        (u'Travel', u'http://www.thestar.com/feeds.articles.life.travel.rss'),
        (u'Technology', u'http://www.thestar.com/feeds.articles.life.technology.rss')
    ]
Attached Files
File Type: zip thestar.zip (903 Bytes, 163 views)
lui1 is offline   Reply With Quote
Old 05-21-2019, 02:16 PM   #3
nanami
Member
nanami began at the beginning.
 
Posts: 12
Karma: 10
Join Date: May 2016
Device: none
Thanks very much!
nanami is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Toronto Star recipe broken: site change nanami Recipes 1 05-08-2016 10:13 AM
Broken Recipe: Toronto Star PeterT Recipes 4 02-01-2013 01:37 PM
Toronto Star missing section thepossum Kobo Reader 3 05-03-2012 06:42 PM
Recipe for a feed that posts epubs: Now Magazine Toronto drgrittani Recipes 7 11-14-2010 09:51 PM
Toronto Star: City libraries phasing out reference books SensualPoet News 13 07-28-2010 07:26 PM


All times are GMT -4. The time now is 09:17 AM.


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