KG updates pre-6.36

This commit is contained in:
GRiker 2010-01-25 09:13:56 -07:00
commit 345e752714
4 changed files with 77 additions and 15 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 788 B

View File

@ -113,3 +113,4 @@ class JASN(BasicNewsRecipe):

View File

@ -0,0 +1,67 @@
__license__ = 'GPL v3'
__copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
'''
www.nursingtimes.net
'''
import urllib
from calibre.web.feeds.recipes import BasicNewsRecipe
class NursingTimes(BasicNewsRecipe):
title = 'Nursing Times'
__author__ = 'Darko Miletic'
description = 'Nursing practice, NHS and health care news'
oldest_article = 8
max_articles_per_feed = 100
no_stylesheets = True
use_embedded_content = False
encoding = 'utf-8'
publisher = 'emap'
category = 'news, health, nursing, UK'
language = 'en-UK'
needs_subscription = True
LOGIN = 'http://www.nursingtimes.net/sign-in'
conversion_options = {
'comments' : description
,'tags' : category
,'language' : language
,'publisher' : publisher
}
def get_browser(self):
br = BasicNewsRecipe.get_browser()
br.open(self.LOGIN)
if self.username is not None and self.password is not None:
data = urllib.urlencode({ 'campaigncode' :'0'
,'referrer' :''
,'security_text':''
,'SIemail' :self.username
,'passWord' :self.password
,'LoginButton.x':'27'
,'LoginButton.y':'13'
})
br.open(self.LOGIN,data)
return br
keep_only_tags = [dict(name='div', attrs={'class':'storytext'})]
remove_tags = [
dict(name=['object','link','script','iframe'])
,dict(name='div',attrs={'id':'comments_form'})
]
remove_tags_after = dict(name='div',attrs={'id':'comments_form'})
feeds = [
(u'Breaking News', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=1')
,(u'Practice', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=512')
,(u'Behind the headlines', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=468')
,(u'Analysis', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=62')
,(u'Acute care news', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=5')
,(u'Primary vare news', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=231')
,(u'Mental Health news', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=27')
,(u'Management news', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=32')
,(u"Older people's nursing news", u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=181')
,(u'Respiratory news', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=177')
,(u'Wound care news', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=182')
]

View File

@ -3,15 +3,11 @@ import os, re, shutil, htmlentitydefs
from collections import namedtuple from collections import namedtuple
from xml.sax.saxutils import escape from xml.sax.saxutils import escape
from PyQt4.Qt import *
from calibre import filesystem_encoding from calibre import filesystem_encoding
from calibre.customize import CatalogPlugin from calibre.customize import CatalogPlugin
from calibre.customize.conversion import OptionRecommendation, DummyReporter from calibre.customize.conversion import OptionRecommendation, DummyReporter
from calibre.ebooks.BeautifulSoup import BeautifulSoup, BeautifulStoneSoup, Tag, NavigableString from calibre.ebooks.BeautifulSoup import BeautifulSoup, BeautifulStoneSoup, Tag, NavigableString
from calibre.ptempfile import PersistentTemporaryDirectory from calibre.ptempfile import PersistentTemporaryDirectory
from calibre.customize.conversion import OptionRecommendation, DummyReporter
from calibre import filesystem_encoding, prints
from calibre.utils.logging import Log from calibre.utils.logging import Log
FIELDS = ['all', 'author_sort', 'authors', 'comments', FIELDS = ['all', 'author_sort', 'authors', 'comments',
@ -2282,8 +2278,6 @@ class EPUB_MOBI(CatalogPlugin):
# The 21-Day Consciousness Cleanse # The 21-Day Consciousness Cleanse
title_words = title.split(' ') title_words = title.split(' ')
if title_words[0].lower() in ['the','a','an']:
stop_word = title_words.pop(0)
# Scan for numbers in each word clump # Scan for numbers in each word clump
translated = [] translated = []