mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-11 09:13:57 -04:00
...
This commit is contained in:
parent
f40f41a889
commit
644e5fe449
@ -1,27 +1,27 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
'''
|
'''
|
||||||
descopera.org
|
descopera.org
|
||||||
'''
|
'''
|
||||||
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
class Descopera(BasicNewsRecipe):
|
class Descopera(BasicNewsRecipe):
|
||||||
title = u'Descoperă.org'
|
title = u'Descoperă.org'
|
||||||
__author__ = 'Marius Ignătescu'
|
__author__ = 'Marius Ignătescu'
|
||||||
description = 'Descoperă. Placerea de a cunoaște'
|
description = 'Descoperă. Placerea de a cunoaște'
|
||||||
publisher = 'descopera.org'
|
publisher = 'descopera.org'
|
||||||
category = 'science, technology, culture, history, earth'
|
category = 'science, technology, culture, history, earth'
|
||||||
language = 'ro'
|
language = 'ro'
|
||||||
oldest_article = 14
|
oldest_article = 14
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
encoding = 'utf8'
|
encoding = 'utf8'
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
extra_css = ' body{ font-family: Verdana,Helvetica,Arial,sans-serif } .introduction{font-weight: bold} .story-feature{display: block; padding: 0; border: 1px solid; width: 40%; font-size: small} .story-feature h2{text-align: center; text-transform: uppercase} '
|
extra_css = ' body{ font-family: Verdana,Helvetica,Arial,sans-serif } .introduction{font-weight: bold} .story-feature{display: block; padding: 0; border: 1px solid; width: 40%; font-size: small} .story-feature h2{text-align: center; text-transform: uppercase} '
|
||||||
keep_only_tags = [dict(name='div', attrs={'class':['post']})]
|
keep_only_tags = [dict(name='div', attrs={'class':['post']})]
|
||||||
remove_tags = [dict(name='div', attrs={'class':['topnav', 'box_a', 'shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge']})]
|
remove_tags = [dict(name='div', attrs={'class':['topnav', 'box_a', 'shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge']})]
|
||||||
remove_attributes = ['width','height']
|
remove_attributes = ['width','height']
|
||||||
cover_url = 'http://www.descopera.org/wp-content/themes/dorg/styles/default/img/b_top.png?width=400'
|
cover_url = 'http://www.descopera.org/wp-content/themes/dorg/styles/default/img/b_top.png?width=400'
|
||||||
feeds = [(u'Articles', u'http://www.descopera.org/feed/')]
|
feeds = [(u'Articles', u'http://www.descopera.org/feed/')]
|
||||||
|
|
||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
return self.adeify_images(soup)
|
return self.adeify_images(soup)
|
||||||
|
@ -79,7 +79,12 @@ def serialize_builtin_recipes():
|
|||||||
from calibre.web.feeds.recipes import compile_recipe
|
from calibre.web.feeds.recipes import compile_recipe
|
||||||
recipe_mapping = {}
|
recipe_mapping = {}
|
||||||
for rid, f in iterate_over_builtin_recipe_files():
|
for rid, f in iterate_over_builtin_recipe_files():
|
||||||
recipe_class = compile_recipe(open(f, 'rb').read())
|
with open(f, 'rb') as stream:
|
||||||
|
try:
|
||||||
|
recipe_class = compile_recipe(stream.read())
|
||||||
|
except:
|
||||||
|
print ('Failed to compile: %s'%f)
|
||||||
|
raise
|
||||||
if recipe_class is not None:
|
if recipe_class is not None:
|
||||||
recipe_mapping['builtin:'+rid] = recipe_class
|
recipe_mapping['builtin:'+rid] = recipe_class
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user