from calibre.web.feeds.news import BasicNewsRecipe


class AdvancedUserRecipe1305547242(BasicNewsRecipe):
    title = u'Good to Know (uk)'
    oldest_article = 14
    max_articles_per_feed = 100
    no_stylesheets = True
    use_embedded_content = False
    remove_javascript = True
    __author__ = 'Anonymous'
    language = 'en_GB'
    remove_tags = [
        dict(name='div', attrs={'class': 'articles_footer', 'class': 'printoptions'})]

    def print_version(self, url):
        return url + '/print/1'

    def preprocess_html(self, soup):
        for alink in soup.findAll('a'):
            if alink.string is not None:
                tstr = alink.string
                alink.replaceWith(tstr)
        return soup

    feeds = [	(u'Family Conception Advice', u'http://www.goodtoknow.co.uk/feeds/family.rss'),
              (u'Family Health Advice', u'http://www.goodtoknow.co.uk/feeds/health.rss'),
              (u'Diet Advice', u'http://www.goodtoknow.co.uk/feeds/diet.rss'),
              (u'Food Advice', u'http://www.goodtoknow.co.uk/feeds/food.rss'),
              (u'Sex Advice', u'http://www.goodtoknow.co.uk/feeds/sex.rss'),
              (u'Easy Exercise', u'http://www.goodtoknow.co.uk/feeds/easyexercise.rss'),
              (u'Recipes', u'http://www.goodtoknow.co.uk/feeds/recipes.rss'),
              (u'Food Quick-tips', u'http://www.goodtoknow.co.uk/feeds/foodquicktips.rss'),
              ]
