calibre/recipes/babyonline.recipe
Kovid Goyal 29cd8d64ea
Change shebangs to python from python2
Also remove a few other miscellaneous references to python2
2020-08-22 18:47:51 +05:30

58 lines
1.6 KiB
Python

#!/usr/bin/env python
# -*- coding: utf-8 -*-
__license__ = 'GPL v3'
__copyright__ = u'2011, Silviu Cotoar\u0103'
'''
babyonline.ro
'''
from calibre.web.feeds.news import BasicNewsRecipe
class BabyOnline(BasicNewsRecipe):
title = u'Baby Online'
__author__ = u'Silviu Cotoar\u0103'
description = u'De la p\u0103rinte la p\u0103rinte'
publisher = u'Baby Online'
oldest_article = 50
language = 'ro'
max_articles_per_feed = 100
no_stylesheets = True
use_embedded_content = False
category = 'Ziare,Reviste,Copii,Mame'
encoding = 'utf-8'
cover_url = 'http://www.babyonline.ro/images/default/logo.gif'
conversion_options = {
'comments': description, 'tags': category, 'language': language, 'publisher': publisher
}
keep_only_tags = [
dict(name='div', attrs={'id': 'article_container'})
]
remove_tags = [
dict(name='div', attrs={'id': 'bar_nav'}),
dict(name='div', attrs={'id': 'service_send'}),
dict(name='div', attrs={'id': 'other_videos'}),
dict(name='div', attrs={'class': 'dot_line_yellow'}),
dict(name='a', attrs={'class': 'print'}),
dict(name='a', attrs={'class': 'email'}),
dict(name='a', attrs={'class': 'YM'}),
dict(name='a', attrs={'class': 'comment'}),
dict(name='div', attrs={'class': 'tombstone_cross'}),
dict(name='span', attrs={'class': 'liketext'})
]
remove_tags_after = [
dict(name='div', attrs={'id': 'service_send'})
]
feeds = [
(u'Feeds', u'http://www.babyonline.ro/rss_homepage.xml')
]
def preprocess_html(self, soup):
return self.adeify_images(soup)