diff --git a/recipes/di.recipe b/recipes/di.recipe
index 932d8e5f08..179983e4dd 100644
--- a/recipes/di.recipe
+++ b/recipes/di.recipe
@@ -46,7 +46,8 @@ class DziennikInternautowRecipe(BasicNewsRecipe):
dict(name = 'div', attrs = {'class' : 'poradniki_context'}),
dict(name = 'div', attrs = {'class' : 'uniBox'}),
dict(name = 'object', attrs = {}),
- dict(name = 'h3', attrs = {})
+ dict(name = 'h3', attrs = {}),
+ dict(attrs={'class':'twitter-share-button'})
]
preprocess_regexps = [
@@ -58,3 +59,8 @@ class DziennikInternautowRecipe(BasicNewsRecipe):
(r'\s*', lambda match: ''),
]
]
+
+ def skip_ad_pages(self, soup):
+ if 'Advertisement' in soup.title:
+ nexturl=soup.find('a')['href']
+ return self.index_to_soup(nexturl, raw=True)
diff --git a/recipes/frazpc.recipe b/recipes/frazpc.recipe
index 2d0d54d10c..b5225e33d5 100644
--- a/recipes/frazpc.recipe
+++ b/recipes/frazpc.recipe
@@ -18,7 +18,7 @@ class FrazPC(BasicNewsRecipe):
max_articles_per_feed = 100
use_embedded_content = False
no_stylesheets = True
-
+ cover_url='http://www.frazpc.pl/images/logo.png'
feeds = [
(u'Aktualno\u015bci', u'http://www.frazpc.pl/feed/aktualnosci'),
(u'Artyku\u0142y', u'http://www.frazpc.pl/feed/artykuly')
@@ -33,6 +33,7 @@ class FrazPC(BasicNewsRecipe):
dict(name='div', attrs={'class':'comments_box'})
]
+ remove_tags_after=dict(name='div', attrs={'class':'content'})
preprocess_regexps = [(re.compile(r'\| Komentarze \([0-9]*\)'), lambda match: '')]
remove_attributes = [ 'width', 'height' ]
diff --git a/recipes/histmag.recipe b/recipes/histmag.recipe
index 38956e7995..846bab2f66 100644
--- a/recipes/histmag.recipe
+++ b/recipes/histmag.recipe
@@ -7,53 +7,18 @@ from calibre.web.feeds.news import BasicNewsRecipe
import re
class Histmag(BasicNewsRecipe):
+ title = u'Histmag'
+ oldest_article = 7
+ max_articles_per_feed = 100
+ cover_url='http://histmag.org/grafika/loga/histmag-logo-2-300px.png'
+ __author__ = 'matek09'
+ description = u"Artykuly historyczne i publicystyczne"
+ encoding = 'utf-8'
+ #preprocess_regexps = [(re.compile(r''), lambda match: '
'),(re.compile(r''), lambda match: '
')]
+ no_stylesheets = True
+ language = 'pl'
+ remove_javascript = True
+ keep_only_tags=[dict(id='article')]
+ remove_tags=[dict(name = 'p', attrs = {'class' : 'article-tags'})]
- title = u'Histmag'
- __author__ = 'matek09'
- description = u"Artykuly historyczne i publicystyczne"
- encoding = 'utf-8'
- no_stylesheets = True
- language = 'pl'
- remove_javascript = True
- #max_articles_per_feed = 1
- remove_tags_before = dict(dict(name = 'div', attrs = {'id' : 'article'}))
- remove_tags_after = dict(dict(name = 'h2', attrs = {'class' : 'komentarze'}))
- #keep_only_tags =[]
- #keep_only_tags.append(dict(name = 'h2'))
- #keep_only_tags.append(dict(name = 'p'))
-
- remove_tags =[]
- remove_tags.append(dict(name = 'p', attrs = {'class' : 'podpis'}))
- remove_tags.append(dict(name = 'h2', attrs = {'class' : 'komentarze'}))
- remove_tags.append(dict(name = 'img', attrs = {'src' : 'style/buttons/wesprzyjnas-1.jpg'}))
-
- preprocess_regexps = [(re.compile(r''), lambda match: '
'),
- (re.compile(r''), lambda match: '
')]
- extra_css = '''
- .left {font-size: x-small}
- .right {font-size: x-small}
- '''
-
- def find_articles(self, soup):
- articles = []
- for div in soup.findAll('div', attrs={'class' : 'text'}):
- articles.append({
- 'title' : self.tag_to_string(div.h3.a),
- 'url' : 'http://www.histmag.org/' + div.h3.a['href'],
- 'date' : self.tag_to_string(div.next('p')).split('|')[0],
- 'description' : self.tag_to_string(div.next('p', podpis=False)),
- })
- return articles
-
- def parse_index(self):
- soup = self.index_to_soup('http://histmag.org/?arc=4&dx=0')
- feeds = []
- feeds.append((u"Artykuly historyczne", self.find_articles(soup)))
- soup = self.index_to_soup('http://histmag.org/?arc=5&dx=0')
- feeds.append((u"Artykuly publicystyczne", self.find_articles(soup)))
- soup = self.index_to_soup('http://histmag.org/?arc=1&dx=0')
- feeds.append((u"Wydarzenia", self.find_articles(soup)))
-
- return feeds
-
-
+ feeds = [(u'Wszystkie', u'http://histmag.org/rss/wszystkie.xml'), (u'Wydarzenia', u'http://histmag.org/rss/wydarzenia.xml'), (u'Recenzje', u'http://histmag.org/rss/recenzje.xml'), (u'Artykuły historyczne', u'http://histmag.org/rss/historia.xml'), (u'Publicystyka', u'http://histmag.org/rss/publicystyka.xml')]
diff --git a/recipes/osnews_pl.recipe b/recipes/osnews_pl.recipe
index 5d851ab179..455f005a7e 100644
--- a/recipes/osnews_pl.recipe
+++ b/recipes/osnews_pl.recipe
@@ -23,7 +23,7 @@ class OSNewsRecipe(BasicNewsRecipe):
oldest_article = 7
max_articles_per_feed = 100
-
+ cover_url='http://osnews.pl/wp-content/themes/osnews/img/logo.png'
extra_css = '''
.news-heading {font-size:150%}
.newsinformations li {display:inline;}
@@ -44,7 +44,9 @@ class OSNewsRecipe(BasicNewsRecipe):
dict(name = 'div', attrs = {'class' : 'sociable'}),
dict(name = 'div', attrs = {'class' : 'post_prev'}),
dict(name = 'div', attrs = {'class' : 'post_next'}),
- dict(name = 'div', attrs = {'class' : 'clr'})
+ dict(name = 'div', attrs = {'class' : 'clr'}),
+ dict(name = 'div', attrs = {'class' : 'tw_button'}),
+ dict(name = 'div', attrs = {'style' : 'width:56px;height:60px;float:left;margin-right:10px'})
]
preprocess_regexps = [(re.compile(u'Komentarze: \(?[0-9]+\)? ?