Kovid's 6.18 changes

This commit is contained in:
GRiker 2009-10-21 09:59:53 -06:00
commit 6767cb547f
345 changed files with 8510 additions and 6418 deletions

View File

@ -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/

2
README
View File

@ -15,3 +15,5 @@ bzr branch lp:calibre
To update your copy of the source code:
bzr merge
Tarballs of the source code for each release are now available \
at http://code.google.com/p/calibre-ebook

Binary file not shown.

After

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 996 B

View File

@ -0,0 +1,77 @@
#!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
'''
www.businessworld.in
'''
from calibre import strftime
from calibre.web.feeds.news import BasicNewsRecipe
class BusinessWorldMagazine(BasicNewsRecipe):
title = 'Business World Magazine'
__author__ = 'Darko Miletic'
description = 'News from India'
publisher = 'ABP Pvt Ltd Publication'
category = 'news, politics, finances, India, Asia'
delay = 1
no_stylesheets = True
INDEX = 'http://www.businessworld.in/bw/Magazine_Current_Issue'
ROOT = 'http://www.businessworld.in'
use_embedded_content = False
encoding = 'utf-8'
language = 'en_IN'
conversion_options = {
'comment' : description
, 'tags' : category
, 'publisher' : publisher
, 'language' : language
}
def is_in_list(self,linklist,url):
for litem in linklist:
if litem == url:
return True
return False
def parse_index(self):
articles = []
linklist = []
soup = self.index_to_soup(self.INDEX)
for item in soup.findAll('div', attrs={'class':'nametitle'}):
description = ''
title_prefix = ''
feed_link = item.find('a')
if feed_link and feed_link.has_key('href'):
url = self.ROOT + feed_link['href']
if not self.is_in_list(linklist,url):
title = title_prefix + self.tag_to_string(feed_link)
date = strftime(self.timefmt)
articles.append({
'title' :title
,'date' :date
,'url' :url
,'description':description
})
linklist.append(url)
return [(soup.head.title.string, articles)]
keep_only_tags = [dict(name='div', attrs={'id':['register-panel','printwrapper']})]
remove_tags = [dict(name=['object','link'])]
def print_version(self, url):
return url.replace('/bw/','/bw/storyContent/')
def get_cover_url(self):
cover_url = None
soup = self.index_to_soup(self.INDEX)
cover_item = soup.find('img',attrs={'class':'toughbor'})
if cover_item:
cover_url = self.ROOT + cover_item['src']
return cover_url

View 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/'

View File

@ -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,14 +23,25 @@ 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('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

Some files were not shown because too many files have changed in this diff Show More