Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 735747ab20
Fetching contributors…

Cannot retrieve contributors at this time

59 lines (48 sloc) 2.67 kb
#!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
'''
www.uncrate.com
'''
from calibre.web.feeds.recipes import BasicNewsRecipe
from calibre.ebooks.BeautifulSoup import Tag
class Uncrate(BasicNewsRecipe):
title = 'Uncrate'
__author__ = 'Darko Miletic'
description = 'Uncrate is a web magazine for guys who love stuff. Our team digs up the best gadgets, clothes, cars, DVDs and more. New items are posted daily. Enjoy responsively.'
oldest_article = 7
max_articles_per_feed = 100
no_stylesheets = True
use_embedded_content = False
encoding = 'utf-8'
publisher = 'Zombie corp.'
category = 'news, gadgets, clothes, cars, DVDs'
lang = 'en-US'
language = 'en'
html2lrf_options = [
'--comment', description
, '--category', category
, '--publisher', publisher
]
html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
keep_only_tags = [dict(name='div', attrs={'class':'lefttext'})]
remove_tags_after = dict(name='div', attrs={'class':'serif'})
remove_tags = [dict(name=['object','link','script','iframe','form'])]
extra_css = '''
.serif{font-family:Georgia,Rockwell,'Times New Roman',Times,serif; font-weight:normal; font-size: x-small; }
.lefttext{font-family:Georgia,Rockwell,'Times New Roman',Times,serif; font-weight:normal; font-size: x-small; }
h1{ font-family:Verdana,Arial,Helvetica,sans-serif;font-size:x-large; font-weight:bold;}
.byline{ font-family:Verdana,Arial,Helvetica,sans-serif;font-size: x-small; color:#FF4000;}
.posted{ font-family:Verdana,Arial,Helvetica,sans-serif;font-size: x-small;}
.answer{ font-family:Verdana,Arial,Helvetica,sans-serif;font-size: x-small;}
a{color:#FF4000;}
'''
feeds = [(u'Articles', u'http://feeds.feedburner.com/uncrate')]
def preprocess_html(self, soup):
mlang = Tag(soup,'meta',[("http-equiv","Content-Language"),("content",self.lang)])
mcharset = Tag(soup,'meta',[("http-equiv","Content-Type"),("content","text/html; charset=utf-8")])
soup.head.insert(0,mlang)
soup.head.insert(1,mcharset)
for item in soup.findAll(style=True):
del item['style']
return self.adeify_images(soup)
Jump to Line
Something went wrong with that request. Please try again.