mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Sync to trunk.
This commit is contained in:
commit
08750ea76e
@ -9,9 +9,9 @@ dist
|
||||
docs
|
||||
resources/localization
|
||||
resources/images.qrc
|
||||
resources/recipes.pickle
|
||||
resources/scripts.pickle
|
||||
resources/ebook-convert-complete.pickle
|
||||
resources/builtin_recipes.xml
|
||||
setup/installer/windows/calibre/build.log
|
||||
src/calibre/translations/.errors
|
||||
src/cssutils/.svn/
|
||||
|
BIN
resources/images/news/dailyreckoning.png
Normal file
BIN
resources/images/news/dailyreckoning.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 996 B |
47
resources/recipes/dailyreckoning.recipe
Normal file
47
resources/recipes/dailyreckoning.recipe
Normal file
@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
dailyreckoning.com
|
||||
'''
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class dailyreckoning_us(BasicNewsRecipe):
|
||||
title = 'The Daily Reckoning - US edition'
|
||||
__author__ = 'Darko Miletic'
|
||||
description = 'Worldwide business and financial news and articles'
|
||||
publisher = 'Agora Financial, LLC.'
|
||||
category = 'news, business, finances, money, banking'
|
||||
oldest_article = 7
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
encoding = 'utf-8'
|
||||
language = 'en'
|
||||
extra_css = ' #BlogTitle{font-size: x-large; font-weight: bold} #BlogDate{font-size: small} '
|
||||
|
||||
conversion_options = {
|
||||
'comment' : description
|
||||
, 'tags' : category
|
||||
, 'publisher' : publisher
|
||||
, 'language' : language
|
||||
}
|
||||
|
||||
feeds = [(u'Articles', u'http://feeds.feedburner.com/dailyreckoning?format=xml')]
|
||||
|
||||
keep_only_tags = [dict(name='div', attrs={'id':'Outline'})]
|
||||
|
||||
remove_tags = [
|
||||
dict(name=['object','link','base'])
|
||||
,dict(name='hr', attrs={'class':'Divider'})
|
||||
]
|
||||
|
||||
remove_tags_after = dict(name='hr', attrs={'class':'Divider'})
|
||||
|
||||
def get_article_url(self, article):
|
||||
return article.get('feedburner_origlink', article.get('link'))
|
||||
|
||||
def print_version(self, url):
|
||||
return url + 'print/'
|
||||
|
@ -8,8 +8,7 @@ economist.com
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
from calibre.ebooks.BeautifulSoup import BeautifulSoup
|
||||
|
||||
import mechanize, string
|
||||
from urllib2 import quote
|
||||
import mechanize, string, urllib
|
||||
|
||||
class Economist(BasicNewsRecipe):
|
||||
|
||||
@ -24,15 +23,26 @@ class Economist(BasicNewsRecipe):
|
||||
cover_url = 'http://www.economist.com/images/covers/currentcovereu_large.jpg'
|
||||
remove_tags = [dict(name=['script', 'noscript', 'title'])]
|
||||
remove_tags_before = dict(name=lambda tag: tag.name=='title' and tag.parent.name=='body')
|
||||
needs_subscription = True
|
||||
|
||||
def get_browser(self):
|
||||
br = BasicNewsRecipe.get_browser()
|
||||
if self.username is not None and self.password is not None:
|
||||
req = mechanize.Request('http://www.economist.com/members/members.cfm?act=exec_login', headers={'Referer':'http://www.economist.com'})
|
||||
data = 'logging_in=Y&returnURL=http%253A%2F%2Fwww.economist.com%2Findex.cfm&email_address=username&pword=password&x=7&y=11'
|
||||
data = data.replace('username', quote(self.username)).replace('password', quote(self.password))
|
||||
req.add_data(data)
|
||||
br.open(req).read()
|
||||
br.open('http://www.economist.com')
|
||||
req = mechanize.Request(
|
||||
'http://www.economist.com/members/members.cfm?act=exec_login',
|
||||
headers = {
|
||||
'Referer':'http://www.economist.com/',
|
||||
},
|
||||
data=urllib.urlencode({
|
||||
'logging_in' : 'Y',
|
||||
'returnURL' : '/',
|
||||
'email_address': self.username,
|
||||
'fakepword' : 'Password',
|
||||
'pword' : self.password,
|
||||
'x' : '0',
|
||||
'y' : '0',
|
||||
}))
|
||||
br.open(req).read()
|
||||
return br
|
||||
|
||||
def parse_index(self):
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user