mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
New recipe for NOAA by Darko Miletic
This commit is contained in:
parent
11c0953f2d
commit
284c3b1797
BIN
src/calibre/gui2/images/news/noaa.png
Normal file
BIN
src/calibre/gui2/images/news/noaa.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 994 B |
@ -47,7 +47,7 @@ recipe_modules = ['recipe_' + r for r in (
|
|||||||
'climate_progress', 'carta', 'slashdot', 'publico',
|
'climate_progress', 'carta', 'slashdot', 'publico',
|
||||||
'the_budget_fashionista', 'elperiodico_catalan',
|
'the_budget_fashionista', 'elperiodico_catalan',
|
||||||
'elperiodico_spanish', 'expansion_spanish', 'lavanguardia',
|
'elperiodico_spanish', 'expansion_spanish', 'lavanguardia',
|
||||||
'marca', 'kellog_faculty', 'kellog_insight',
|
'marca', 'kellog_faculty', 'kellog_insight', 'noaa',
|
||||||
'theeconomictimes_india', '7dias', 'buenosaireseconomico',
|
'theeconomictimes_india', '7dias', 'buenosaireseconomico',
|
||||||
'diagonales', 'miradasalsur', 'newsweek_argentina', 'veintitres',
|
'diagonales', 'miradasalsur', 'newsweek_argentina', 'veintitres',
|
||||||
'gva_be', 'hln', 'tijd', 'degentenaar', 'inquirer_net', 'uncrate',
|
'gva_be', 'hln', 'tijd', 'degentenaar', 'inquirer_net', 'uncrate',
|
||||||
|
41
src/calibre/web/feeds/recipes/recipe_noaa.py
Normal file
41
src/calibre/web/feeds/recipes/recipe_noaa.py
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
|
'''
|
||||||
|
noaa.com
|
||||||
|
'''
|
||||||
|
|
||||||
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
from calibre.ebooks.BeautifulSoup import Tag
|
||||||
|
|
||||||
|
class NOAA(BasicNewsRecipe):
|
||||||
|
title = 'NOAA Online'
|
||||||
|
__author__ = 'Darko Miletic'
|
||||||
|
description = 'NOAA'
|
||||||
|
publisher = 'NOAA'
|
||||||
|
category = 'news, science, US, ocean'
|
||||||
|
oldest_article = 15
|
||||||
|
max_articles_per_feed = 100
|
||||||
|
no_stylesheets = True
|
||||||
|
use_embedded_content = False
|
||||||
|
simultaneous_downloads = 1
|
||||||
|
encoding = 'utf-8'
|
||||||
|
lang = 'en-US'
|
||||||
|
language = _('English')
|
||||||
|
|
||||||
|
|
||||||
|
remove_tags = [dict(name=['embed','object'])]
|
||||||
|
keep_only_tags = [dict(name='div', attrs={'id':'contentArea'})]
|
||||||
|
|
||||||
|
feeds = [(u'NOAA articles', u'http://www.rss.noaa.gov/noaarss.xml')]
|
||||||
|
|
||||||
|
def preprocess_html(self, soup):
|
||||||
|
soup.html['xml:lang'] = self.lang
|
||||||
|
soup.html['lang'] = self.lang
|
||||||
|
mlang = Tag(soup,'meta',[("http-equiv","Content-Language"),("content",self.lang)])
|
||||||
|
mcharset = Tag(soup,'meta',[("http-equiv","Content-Type"),("content","text/html; charset=UTF-8")])
|
||||||
|
soup.head.insert(0,mlang)
|
||||||
|
soup.head.insert(1,mcharset)
|
||||||
|
return self.adeify_images(soup)
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user