From d4e611508a9d4fb2360e952c10e419819454319c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 8 Mar 2010 10:03:20 -0700 Subject: [PATCH] Elsevier.nl by Darko Miletic --- resources/images/news/elsevier.png | Bin 0 -> 568 bytes resources/recipes/elsevier.recipe | 65 +++++++++++++++++++++++++++++ src/calibre/manual/faq.rst | 6 +++ 3 files changed, 71 insertions(+) create mode 100644 resources/images/news/elsevier.png create mode 100644 resources/recipes/elsevier.recipe diff --git a/resources/images/news/elsevier.png b/resources/images/news/elsevier.png new file mode 100644 index 0000000000000000000000000000000000000000..373b39cd7c2b3d75f5250fe83f786086c047995a GIT binary patch literal 568 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zK-vS0-A-oPfdtD69Mgd`SU*F|v9*U87#I^hT^vI!PA{EwR@)^}j;_mT~d9q+j_ zarwQome2owEt#h*l9^oT8g0XG^5fnHrI^k{1535|(-V^%c0a#3Gm0s`@z5HlP*wHI zkB>fH+Tf$d{xUp(@zQ(-eeZMphZq+qFe%+p6S}iQPwj)??Ps@2PcbqyI`y7T+|zik zv+$w#%uADM9JJu{7|X zmA&E2oN86UZhPHKv5$Gy(X8IZ+cen~eoAl9T^A<4qvl)yRK;r>Op^B)Q#xEi!HBC=nH1Y5)(jg8?b zS16mZJ3^$U;a30oB$3`*4;zwCKdMpdTy!*AG21Kr8{4&a1)(fOlYaq2UbVzEq9i4; zB-JXpC>2OC7#SEE=o%R78d!uF8dw<^SQ(q?8khqa6Ce30p=ij>PsvQHMAKkoX=P{u V(GYe=Vk=MsgQu&X%Q~loCIBh--C+O# literal 0 HcmV?d00001 diff --git a/resources/recipes/elsevier.recipe b/resources/recipes/elsevier.recipe new file mode 100644 index 0000000000..389ce3f74d --- /dev/null +++ b/resources/recipes/elsevier.recipe @@ -0,0 +1,65 @@ +__license__ = 'GPL v3' +__copyright__ = '2010, Darko Miletic ' +''' +elsevier.nl +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Pagina12(BasicNewsRecipe): + title = 'Elsevier.nl' + __author__ = 'Darko Miletic' + description = 'News from Denmark' + publisher = 'elsevier.nl' + category = 'news, politics, Denmark' + oldest_article = 2 + max_articles_per_feed = 200 + no_stylesheets = True + encoding = 'utf-8' + use_embedded_content = False + language = 'nl' + country = 'NL' + remove_empty_feeds = True + masthead_url = 'http://www.elsevier.nl/static/elsevier/stdimg/logo.gif' + extra_css = ' body{font-family: Arial,Helvetica,sans-serif } img{margin-bottom: 0.4em} ' + + conversion_options = { + 'comment' : description + , 'tags' : category + , 'publisher' : publisher + , 'language' : language + } + + keep_only_tags = dict(attrs={'id':'artikel_container'}) + remove_tags_before = dict(attrs={'id':'breadcrumb_container'}) + remove_tags_after = dict(attrs={'class':'author_link'}) + remove_tags = [ + dict(attrs={'id':'breadcrumb_container'}) + ,dict(name='div',attrs={'class':'pullout_vak'}) + ] + remove_attributes = ['width','height'] + + feeds = [ + (u'Laatste nieuws' , u'http://www.elsevier.nl/web/RSS/Homepage-RSS.htm?output=xml' ) + ,(u'Nederland' , u'http://www.elsevier.nl/web/RSS/Nederland-RSS.htm?output=xml' ) + ,(u'Politiek' , u'http://www.elsevier.nl/web/RSS/Politiek-RSS.htm?output=xml' ) + ,(u'Europese Unie' , u'http://www.elsevier.nl/web/RSS/Europese-Unie-RSS.htm?output=xml' ) + ,(u'Buitenland' , u'http://www.elsevier.nl/web/RSS/Buitenland-RSS.htm?output=xml' ) + ,(u'Economie' , u'http://www.elsevier.nl/web/RSS/Economie-RSS.htm?output=xml' ) + ,(u'Wetenschap' , u'http://www.elsevier.nl/web/RSS/Wetenschap-RSS.htm?output=xml' ) + ,(u'Cultuur & Televisie' , u'http://www.elsevier.nl/web/RSS/Cultuur-Televisie-RSS.htm?output=xml') + ,(u'Society' , u'http://www.elsevier.nl/web/RSS/Society-RSS.htm?output=xml' ) + ,(u'Internet&/Gadgets' , u'http://www.elsevier.nl/web/RSS/Internet-Gadgets-RSS.htm?output=xml' ) + ,(u'Comentaren' , u'http://www.elsevier.nl/web/RSS/Commentaren-RSS.htm?output=xml' ) + ] + + def print_version(self, url): + return url + '?print=true' + + def get_article_url(self, article): + return article.get('guid', None).rpartition('?')[0] + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + return soup diff --git a/src/calibre/manual/faq.rst b/src/calibre/manual/faq.rst index ba186a0c10..c38f4f1d23 100644 --- a/src/calibre/manual/faq.rst +++ b/src/calibre/manual/faq.rst @@ -313,3 +313,9 @@ I want some feature added to |app|. What can I do? You have two choices: 1. Create a patch by hacking on |app| and send it to me for review and inclusion. See `Development `_. 2. `Open a ticket `_ (you have to register and login first) and hopefully I will find the time to implement your feature. + +Can I include |app| on a CD to be distributed with my product/magazine? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +|app| is licensed under the GNU General Public License v3 (an open source license). This means that you are free to redistribute |app| as long as you make the source code available. So if you want to put |app| on a CD with your product, you must also put the |app| source code on the CD. The source code is available for download `here `_. + +