diff --git a/resources/images/news/gamasutra_fa.png b/resources/images/news/gamasutra_fa.png new file mode 100644 index 0000000000..7d7c4eab6e Binary files /dev/null and b/resources/images/news/gamasutra_fa.png differ diff --git a/resources/images/news/gamasutra_news.png b/resources/images/news/gamasutra_news.png new file mode 100644 index 0000000000..7d7c4eab6e Binary files /dev/null and b/resources/images/news/gamasutra_news.png differ diff --git a/resources/recipes/gamasutra_fa.recipe b/resources/recipes/gamasutra_fa.recipe new file mode 100644 index 0000000000..26a56849f7 --- /dev/null +++ b/resources/recipes/gamasutra_fa.recipe @@ -0,0 +1,56 @@ +__license__ = 'GPL v3' +__copyright__ = '2010, Darko Miletic ' +''' +gamasutra.com +''' + +import re +from calibre.web.feeds.news import BasicNewsRecipe + +class Gamasutra(BasicNewsRecipe): + title = 'Gamasutra Featured articles' + __author__ = 'Darko Miletic' + description = 'The Art and Business of Making Games' + publisher = 'Gamasutra' + category = 'news, games, IT' + oldest_article = 2 + max_articles_per_feed = 200 + no_stylesheets = True + encoding = 'cp1252' + use_embedded_content = False + language = 'en' + remove_empty_feeds = True + masthead_url = 'http://www.gamasutra.com/images/gamasutra_logo.gif' + extra_css = ' body{font-family: Verdana,Arial,Helvetica,sans-serif } img{margin-bottom: 0.4em} .title{font-size: x-large; font-weight: bold} ' + + conversion_options = { + 'comment' : description + , 'tags' : category + , 'publisher' : publisher + , 'language' : language + , 'linearize_tables' : True + } + preprocess_regexps = [ + (re.compile(r'.*?', re.DOTALL|re.IGNORECASE),lambda match: '<head><title>') + ,(re.compile(r'.*?', re.DOTALL|re.IGNORECASE),lambda match: '') + ,(re.compile(r'', re.DOTALL|re.IGNORECASE),lambda match: '') + ] + remove_tags = [ + dict(name=['object','embed','iframe']) + ,dict(attrs={'class':'adBox'}) + ] + remove_tags_before = dict(attrs={'class':'title'}) + remove_attributes = ['width','height','name'] + + feeds = [(u'Feature Articles', u'http://feeds.feedburner.com/GamasutraFeatureArticles')] + + def print_version(self, url): + return url + '?print=1' + + def get_article_url(self, article): + return article.get('guid', None) + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + return self.adeify_images(soup) diff --git a/resources/recipes/gamasutra_news.recipe b/resources/recipes/gamasutra_news.recipe new file mode 100644 index 0000000000..ab7a089e1c --- /dev/null +++ b/resources/recipes/gamasutra_news.recipe @@ -0,0 +1,45 @@ +__license__ = 'GPL v3' +__copyright__ = '2010, Darko Miletic ' +''' +gamasutra.com +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Gamasutra(BasicNewsRecipe): + title = 'Gamasutra News' + __author__ = 'Darko Miletic' + description = 'The Art and Business of Making Games' + publisher = 'Gamasutra' + category = 'news, games, IT' + oldest_article = 2 + max_articles_per_feed = 200 + no_stylesheets = True + encoding = 'cp1252' + use_embedded_content = False + language = 'en' + remove_empty_feeds = True + masthead_url = 'http://www.gamasutra.com/images/gamasutra_logo.gif' + extra_css = ' body{font-family: Verdana,Arial,Helvetica,sans-serif } img{margin-bottom: 0.4em} .newsTitle{font-size: xx-large; font-weight: bold} ' + + conversion_options = { + 'comment' : description + , 'tags' : category + , 'publisher' : publisher + , 'language' : language + , 'linearize_tables' : True + } + + remove_tags = [dict(attrs={'class':['relatedNews','adBox']})] + keep_only_tags = [dict(attrs={'class':['newsTitle','newsAuth','newsDate','newsText']})] + remove_attributes = ['width','height'] + + feeds = [(u'News', u'http://feeds.feedburner.com/GamasutraNews')] + + def get_article_url(self, article): + return article.get('guid', None) + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + return self.adeify_images(soup) diff --git a/src/calibre/ebooks/pdb/pdf/reader.py b/src/calibre/ebooks/pdb/pdf/reader.py index 913d06f634..7ad5776325 100644 --- a/src/calibre/ebooks/pdb/pdf/reader.py +++ b/src/calibre/ebooks/pdb/pdf/reader.py @@ -8,7 +8,6 @@ __license__ = 'GPL v3' __copyright__ = '2010, John Schember ' __docformat__ = 'restructuredtext en' -import cStringIO from calibre.ebooks.pdb.formatreader import FormatReader from calibre.ptempfile import TemporaryFile