mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'master' of https://github.com/t3d/calibre
This commit is contained in:
commit
f5a91cae98
@ -1,51 +0,0 @@
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
class Bash_org_pl(BasicNewsRecipe):
|
||||
title = u'Bash.org.pl'
|
||||
__author__ = 'fenuks'
|
||||
description = 'Bash.org.pl - zabawne cytaty z IRC'
|
||||
category = 'funny quotations, humour'
|
||||
language = 'pl'
|
||||
cover_url = u'http://userlogos.org/files/logos/dzikiosiol/none_0.png'
|
||||
max_articles_per_feed = 50
|
||||
no_stylesheets = True
|
||||
keep_only_tags = [dict(name='a', attrs={'class': 'qid click'}),
|
||||
dict(name='div', attrs={'class': 'quote post-content post-body'})]
|
||||
|
||||
def latest_articles(self):
|
||||
articles = []
|
||||
soup = self.index_to_soup(u'http://bash.org.pl/latest/')
|
||||
tags = soup.findAll('a', attrs={'class': 'qid click'})
|
||||
for a in tags:
|
||||
title = a.string
|
||||
url = 'http://bash.org.pl' + a['href']
|
||||
articles.append({'title': title,
|
||||
'url': url,
|
||||
'date': '',
|
||||
'description': ''
|
||||
})
|
||||
return articles
|
||||
|
||||
def random_articles(self):
|
||||
articles = []
|
||||
for i in range(self.max_articles_per_feed):
|
||||
soup = self.index_to_soup(u'http://bash.org.pl/random/')
|
||||
url = soup.find('a', attrs={'class': 'qid click'})
|
||||
title = ''
|
||||
url = 'http://bash.org.pl/random/'
|
||||
articles.append({'title': title,
|
||||
'url': url,
|
||||
'date': '',
|
||||
'description': ''
|
||||
})
|
||||
return articles
|
||||
|
||||
def populate_article_metadata(self, article, soup, first):
|
||||
article.title = soup.find(attrs={'class': 'qid click'}).string
|
||||
|
||||
def parse_index(self):
|
||||
feeds = []
|
||||
feeds.append((u"Najnowsze", self.latest_articles()))
|
||||
feeds.append((u"Losowe", self.random_articles()))
|
||||
return feeds
|
@ -1,56 +0,0 @@
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
from calibre.ebooks.BeautifulSoup import BeautifulSoup, Comment
|
||||
|
||||
|
||||
class CoNowegoPl(BasicNewsRecipe):
|
||||
title = u'conowego.pl'
|
||||
__author__ = 'fenuks'
|
||||
description = u'Nowy wortal technologiczny oraz gazeta internetowa. Testy najnowszych produktów, fachowe porady i recenzje. U nas znajdziesz wszystko o elektronice użytkowej !' # noqa
|
||||
category = 'IT, news'
|
||||
language = 'pl'
|
||||
oldest_article = 7
|
||||
max_articles_per_feed = 100
|
||||
INDEX = 'http://www.conowego.pl/'
|
||||
extra_css = '.news-single-img {float:left; margin-right:5px;}'
|
||||
no_stylesheets = True
|
||||
remove_empty_feeds = True
|
||||
use_embedded_content = False
|
||||
ignore_duplicate_articles = {'title', 'url'}
|
||||
keep_only_tags = [
|
||||
dict(name='div', attrs={'class': 'news_list single_view'})]
|
||||
remove_tags = [
|
||||
dict(name='div', attrs={'class': ['ni_bottom', 'ni_rank', 'ni_date']})]
|
||||
feeds = [(u'Aktualno\u015bci', u'http://www.conowego.pl/rss/aktualnosci-5/?type=100'), (u'Gaming', u'http://www.conowego.pl/rss/gaming-6/?type=100'),
|
||||
(u'Porady', u'http://www.conowego.pl/rss/porady-3/?type=100'), (u'Testy', u'http://www.conowego.pl/rss/testy-2/?type=100')]
|
||||
|
||||
def preprocess_html(self, soup):
|
||||
for i in soup.findAll('img'):
|
||||
i.parent.insert(0, BeautifulSoup('<br />'))
|
||||
i.insert(len(i), BeautifulSoup('<br />'))
|
||||
self.append_page(soup, soup.body)
|
||||
return soup
|
||||
|
||||
def append_page(self, soup, appendtag):
|
||||
tag = appendtag.find('div', attrs={'class': 'pages'})
|
||||
if tag:
|
||||
nexturls = tag.findAll('a')
|
||||
for nexturl in nexturls[:-1]:
|
||||
soup2 = self.index_to_soup(
|
||||
'http://www.conowego.pl/' + nexturl['href'])
|
||||
pagetext = soup2.find(attrs={'class': 'ni_content'})
|
||||
pos = len(appendtag.contents)
|
||||
appendtag.insert(pos, pagetext)
|
||||
|
||||
comments = appendtag.findAll(
|
||||
text=lambda text: isinstance(text, Comment))
|
||||
for comment in comments:
|
||||
comment.extract()
|
||||
for r in appendtag.findAll(attrs={'class': ['pages', 'paginationWrap']}):
|
||||
r.extract()
|
||||
|
||||
def get_cover_url(self):
|
||||
soup = self.index_to_soup('http://www.conowego.pl/magazyn/')
|
||||
tag = soup.find(attrs={'class': 'ms_left'})
|
||||
if tag:
|
||||
self.cover_url = self.INDEX + tag.find('img')['src']
|
||||
return getattr(self, 'cover_url', self.cover_url)
|
@ -9,7 +9,7 @@ class CzasGentlemanow(BasicNewsRecipe):
|
||||
description = u'Historia mężczyzn z dala od wielkiej polityki'
|
||||
category = 'blog'
|
||||
language = 'pl'
|
||||
cover_url = 'http://czasgentlemanow.pl/wp-content/uploads/2012/10/logo-Czas-Gentlemanow1.jpg'
|
||||
cover_url = 'https://czasgentlemanow.pl/wp-content/uploads/2012/10/logo-Czas-Gentlemanow1.jpg'
|
||||
ignore_duplicate_articles = {'title', 'url'}
|
||||
oldest_article = 7
|
||||
max_articles_per_feed = 100
|
||||
@ -17,18 +17,10 @@ class CzasGentlemanow(BasicNewsRecipe):
|
||||
.wp-caption-text {text-align: left;} img.aligncenter {display: block; margin-left: auto; margin-right: auto;} .alignleft {float: left; margin-right:5px;}'
|
||||
no_stylesheets = True
|
||||
remove_empty_feeds = True
|
||||
preprocess_regexps = [
|
||||
(re.compile(u'<h3>Może Cię też zainteresować:</h3>'), lambda m: '')]
|
||||
use_embedded_content = False
|
||||
keep_only_tags = [dict(name='div', attrs={'class': 'content'})]
|
||||
remove_tags = [dict(attrs={'class': 'meta_comments'}), dict(
|
||||
id=['comments', 'related_posts_thumbnails', 'respond'])]
|
||||
remove_tags_after = dict(id='comments')
|
||||
keep_only_tags = [dict(name='div', attrs={'class': 'post-wrapper'})]
|
||||
remove_tags = [dict(attrs={'class': ['awac-wrapper', 'post-bottom', 'comment', 'seperate']})]
|
||||
feeds = [
|
||||
(u'M\u0119ski \u015awiat', u'http://czasgentlemanow.pl/category/meski-swiat/feed/'),
|
||||
(u'Styl', u'http://czasgentlemanow.pl/category/styl/feed/'),
|
||||
(u'Vademecum Gentlemana', u'http://czasgentlemanow.pl/category/vademecum/feed/'),
|
||||
|
||||
(u'Dom i rodzina', u'http://czasgentlemanow.pl/category/dom-i-rodzina/feed/'),
|
||||
(u'Honor', u'http://czasgentlemanow.pl/category/honor/feed/'),
|
||||
(u'Gad\u017cety Gentlemana', u'http://czasgentlemanow.pl/category/gadzety-gentlemana/feed/')]
|
||||
(u'Charakter', u'https://czasgentlemanow.pl/category/charakter/feed/'),
|
||||
(u'Wizerunek', u'https://czasgentlemanow.pl/category/wizerunek/feed/'),
|
||||
(u'Relacje międzyludzkie', u'https://czasgentlemanow.pl/category/relacje-miedzyludzkie/feed/')]
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 473 B |
Binary file not shown.
Before Width: | Height: | Size: 481 B |
Binary file not shown.
Before Width: | Height: | Size: 881 B |
@ -6,7 +6,6 @@ class MyAppleRecipe(BasicNewsRecipe):
|
||||
__license__ = 'GPL v3'
|
||||
__author__ = u'Artur Stachecki <artur.stachecki@gmail.com>'
|
||||
language = 'pl'
|
||||
version = 1
|
||||
|
||||
title = u'MyApple.pl'
|
||||
category = u'News'
|
||||
@ -22,16 +21,10 @@ class MyAppleRecipe(BasicNewsRecipe):
|
||||
remove_javascript = True
|
||||
simultaneous_downloads = 3
|
||||
|
||||
keep_only_tags = []
|
||||
keep_only_tags.append(dict(name='div', attrs={'id': 'article_content'}))
|
||||
keep_only_tags = [dict(name='article')]
|
||||
|
||||
remove_tags = []
|
||||
remove_tags.append(
|
||||
dict(name='div', attrs={'class': 'article_author_date_comment_container'}))
|
||||
remove_tags.append(dict(name='div', attrs={'class': 'fullwidth'}))
|
||||
remove_tags.append(dict(name='div', attrs={'class': 'cmslinks'}))
|
||||
remove_tags.append(dict(name='div', attrs={'class': 'googleads-468'}))
|
||||
remove_tags.append(dict(name='div', attrs={'id': 'comments'}))
|
||||
remove_tags = [dict(name='a', attrs={'class': 'twitter-follow-button'}),
|
||||
dict(name='ul', attrs={'class': 'list-inline text-muted small mb-0 mt-1'})]
|
||||
|
||||
extra_css = '''
|
||||
body {font-family: verdana, arial, helvetica, geneva, sans-serif ;}
|
||||
@ -39,7 +32,7 @@ class MyAppleRecipe(BasicNewsRecipe):
|
||||
'''
|
||||
|
||||
feeds = [
|
||||
('News', 'feed://myapple.pl/external.php?do=rss&type=newcontent§ionid=1&days=120&count=10'),
|
||||
('Wpisy', 'https://myapple.pl/posts.atom'),
|
||||
]
|
||||
|
||||
def preprocess_html(self, soup):
|
||||
|
@ -1,27 +0,0 @@
|
||||
#!/usr/bin/env python2
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__author__ = 'teepel <teepel44@gmail.com>'
|
||||
|
||||
'''
|
||||
samcik.blox.pl
|
||||
'''
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
class samcik(BasicNewsRecipe):
|
||||
title = u'Maciej Samcik Blog'
|
||||
__author__ = 'teepel <teepel44@gmail.com>'
|
||||
language = 'pl'
|
||||
description = u'Blog Macieja Samcika, długoletniego dziennikarza ekonomicznego Gazety Wyborczej . O finansach małych i dużych. Mnóstwo ciekawostek na temat pieniędzy.' # noqa
|
||||
oldest_article = 7
|
||||
max_articles_per_feed = 100
|
||||
remove_javascript = True
|
||||
no_stylesheets = True
|
||||
simultaneous_downloads = 3
|
||||
|
||||
remove_tags = []
|
||||
remove_tags.append(dict(name='table', attrs={'border': '0'}))
|
||||
|
||||
feeds = [(u'Wpisy', u'http://samcik.blox.pl/rss2')]
|
Loading…
x
Reference in New Issue
Block a user