mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Update Linux Magazine
Fixes #1453406 [Updated recipe for Linux Magazine](https://bugs.launchpad.net/calibre/+bug/1453406)
This commit is contained in:
parent
e62986fa41
commit
383643a9d1
@ -1,38 +1,42 @@
|
||||
#!/usr/bin/env python2
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
|
||||
__copyright__ = '2008-2015 , Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
linux-magazine.com
|
||||
'''
|
||||
|
||||
from calibre.ebooks.BeautifulSoup import BeautifulSoup
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class LinuxMagazine(BasicNewsRecipe):
|
||||
title = u'Linux Magazine'
|
||||
title = 'Linux Magazine'
|
||||
__author__ = 'Darko Miletic'
|
||||
description = 'Linux news'
|
||||
language = 'en'
|
||||
|
||||
oldest_article = 7
|
||||
description = 'Linux news'
|
||||
publisher = 'Linux Magazine'
|
||||
category = 'news, linux, open source, software'
|
||||
language = 'en'
|
||||
encoding = 'utf-8'
|
||||
oldest_article = 35
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
|
||||
remove_tags_after = dict(name='div', attrs={'class':'end_intro'})
|
||||
conversion_options = {
|
||||
'comment' : description
|
||||
, 'tags' : category
|
||||
, 'publisher' : publisher
|
||||
, 'language' : language
|
||||
}
|
||||
|
||||
|
||||
keep_only_tags=dict(name='div', attrs={'class':lambda x:'full' in (x or '').split()})
|
||||
|
||||
remove_tags_after = dict(name='div', attrs={'id':'disqus_thread'})
|
||||
remove_tags = [
|
||||
dict(name='div' , attrs={'class':'end_intro' })
|
||||
,dict(name='table' , attrs={'width':'100%'})
|
||||
dict(name='div' , attrs={'class':['attribute-relatedcontent',
|
||||
'social_bookmarks',
|
||||
'paginate'] })
|
||||
,dict(name='div' , attrs={'id':'articlebox'})
|
||||
]
|
||||
|
||||
feeds = [(u'Linux Magazine Full Feed', u'http://www.linux-magazine.com/rss/feed/lmi_full')]
|
||||
|
||||
def print_version(self, url):
|
||||
raw = self.browser.open(url).read()
|
||||
soup = BeautifulSoup(raw.decode('utf8', 'replace'))
|
||||
print_link = soup.find('a', {'title':'Print this page'})
|
||||
if print_link is None:
|
||||
return url
|
||||
return 'http://www.linux-magazine.com'+print_link['href']
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user