mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix New Journal of Physics
This commit is contained in:
parent
2bc5e93d16
commit
99a39f4f1f
@ -1,14 +1,25 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
##
|
||||||
|
## Title: New Journal of Physics
|
||||||
|
## License: GNU General Public License v3 - http://www.gnu.org/copyleft/gpl.html
|
||||||
|
## Copyright: Chema Cort\xe9s
|
||||||
|
##
|
||||||
|
## Written: Jan 2011
|
||||||
|
## Last Edited: Jan 2012 - by Kiavash
|
||||||
|
##
|
||||||
|
|
||||||
|
__license__ = 'GNU General Public License v3 - http://www.gnu.org/copyleft/gpl.html'
|
||||||
__copyright__ = u'Chema Cort\xe9s - 2011-01-05'
|
__copyright__ = u'Chema Cort\xe9s - 2011-01-05'
|
||||||
__version__ = 'v0.01'
|
__version__ = 'v0.5.0'
|
||||||
__date__ = '2011-01-05'
|
__date__ = '2012-01-13'
|
||||||
|
|
||||||
'''
|
'''
|
||||||
njp.org
|
njp.org
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
import re # Import the regular expressions module.
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
class NewJournalOfPhysics(BasicNewsRecipe):
|
class NewJournalOfPhysics(BasicNewsRecipe):
|
||||||
@ -18,15 +29,61 @@ class NewJournalOfPhysics(BasicNewsRecipe):
|
|||||||
publisher = u'IOP (Institute of Physics)'
|
publisher = u'IOP (Institute of Physics)'
|
||||||
category = 'physics, journal, science'
|
category = 'physics, journal, science'
|
||||||
language = 'en'
|
language = 'en'
|
||||||
|
|
||||||
oldest_article = 30
|
|
||||||
max_articles_per_feed = 100
|
|
||||||
|
|
||||||
keep_only_tags = [dict(id=['fulltextContainer'])]
|
|
||||||
no_stylesheets=True
|
|
||||||
use_embedded_content=False
|
|
||||||
|
|
||||||
feeds = [(u'Latest Papers', u'http://iopscience.iop.org/1367-2630/?rss=1')]
|
feeds = [(u'Latest Papers', u'http://iopscience.iop.org/1367-2630/?rss=1')]
|
||||||
|
|
||||||
|
cover_url = 'http://images.iop.org/journals_icons/Info/1367-2630/cover.gif'
|
||||||
|
|
||||||
|
oldest_article = 7
|
||||||
|
max_articles_per_feed = 30
|
||||||
|
timeout = 30
|
||||||
|
|
||||||
|
no_stylesheets = True
|
||||||
|
use_embedded_content = False
|
||||||
|
remove_javascript = True
|
||||||
|
remove_empty_feeds = True
|
||||||
|
asciiize = True # Converts all none ascii characters to their ascii equivalents
|
||||||
|
|
||||||
|
keep_only_tags = [
|
||||||
|
dict(id=['articleEvoContainer']),
|
||||||
|
]
|
||||||
|
|
||||||
|
remove_tags = [
|
||||||
|
dict(name='div', attrs={'class':'affiliations'}), # Removes Shoow Affiliations
|
||||||
|
dict(name='div', attrs={'class':'abst-icon-links'}), # Removes Tags and PDF export
|
||||||
|
dict(name='p', attrs={'class':'studyimage'}), # remove Studay image
|
||||||
|
dict(name='a', attrs={'class':'icon powerpoint'}), # remove Export to PowerPoint Slide
|
||||||
|
dict(name='a', attrs={'title':'CrossRef'}), # remove CrossRef icon
|
||||||
|
dict(name='a', attrs={'title':'PubMed'}), # remove PubMed icon
|
||||||
|
dict(name='a', attrs={'e4f5426941':'true'}), # remove cross ref image
|
||||||
|
dict(name='img', attrs={'src':''}), # remove empty image
|
||||||
|
dict(name='a', attrs={'class':'closeChap'}), # remove 'Close'
|
||||||
|
dict(name='ul', attrs={'class':'breadcrumbs'}), # remove Top breadcrumbs
|
||||||
|
]
|
||||||
|
|
||||||
|
extra_css = 'body { font-family: verdana, helvetica, sans-serif; } \
|
||||||
|
.introduction, .first { font-weight: bold; } \
|
||||||
|
.cross-head { font-weight: bold; font-size: 125%; } \
|
||||||
|
.cap, .caption { display: block; font-size: 80%; font-style: italic; } \
|
||||||
|
.cap, .caption, .caption img, .caption span { display: block; margin: 5px auto; } \
|
||||||
|
.byl, .byd, .byline img, .byline-name, .byline-title, .author-name, .author-position, \
|
||||||
|
.correspondent-portrait img, .byline-lead-in, .name, .bbc-role { display: block; \
|
||||||
|
font-size: 80%; font-style: italic; margin: 1px auto; } \
|
||||||
|
.story-date, .published { font-size: 80%; } \
|
||||||
|
table { width: 100%; } \
|
||||||
|
td img { display: block; margin: 5px auto; } \
|
||||||
|
ul { padding-top: 10px; } \
|
||||||
|
ol { padding-top: 10px; } \
|
||||||
|
li { padding-top: 5px; padding-bottom: 5px; } \
|
||||||
|
h1 { font-size: 175%; font-weight: bold; } \
|
||||||
|
h2 { font-size: 150%; font-weight: bold; } \
|
||||||
|
h3 { font-size: 125%; font-weight: bold; } \
|
||||||
|
h4, h5, h6 { font-size: 100%; font-weight: bold; }'
|
||||||
|
|
||||||
|
# Remove the line breaks.
|
||||||
|
preprocess_regexps = [(re.compile(r'<br[ ]*/>', re.IGNORECASE), lambda m: ''),
|
||||||
|
(re.compile(r'<br[ ]*clear.*/>', re.IGNORECASE), lambda m: ''),
|
||||||
|
]
|
||||||
|
|
||||||
def print_version(self, url):
|
def print_version(self, url):
|
||||||
return url+"/fulltext"
|
return url+"/article"
|
Loading…
x
Reference in New Issue
Block a user