View Single Post
Old 01-11-2010, 10:16 AM   #3
megabadd
Enthusiast
megabadd began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Dec 2009
Device: Astak PP
My second recipe here is in unindent problem.

This recipe downloads a file but with no changes on my ereader (viewable on my comp tho):

#!/usr/bin/env python

__license__ = 'GPL v3'
__copyright__ = '2008 - 2009, Darko Miletic <darko.miletic at gmail.com>'
'''
engadget.com
'''

from calibre.web.feeds.news import BasicNewsRecipe

class Engadget(BasicNewsRecipe):
title = u'Engadgetreelz'
__author__ = 'Darko Miletic'
description = 'Tech news'
language = 'ja'
oldest_article = 7
max_articles_per_feed = 100
no_stylesheets = True
use_embedded_content = True
feeds = [ (u'Posts', u'http://japanese.engadget.com/rss.xml')]

extra_css = '\
@font-face {font-family: "Ryo Gothic PlusN M";src:url(res:///abook/fonts/ryogothicplusnmediumfont.ttf)}\n\
.article_description{font-family: Ryo Gothic PlusN M}\n\
p{font-family: Ryo Gothic PlusN M}\n\
h1 {font-weight: normal;}\n\
h2 {font-style: normal;}\n'

def postprocess_html(self, soup, f):
soup.find('html')['xml:lang'] = 'ja' ['lang'] = 'ja'
return soup



Calibre won't accept this recipe:

#!/usr/bin/env python

__license__ = 'GPL v3'
__copyright__ = '2008 - 2009, Darko Miletic <darko.miletic at gmail.com>'
'''
engadget.com
'''

from calibre.web.feeds.news import BasicNewsRecipe

class Engadget(BasicNewsRecipe):
title = u'EngadgetreelzFont'
__author__ = 'Darko Miletic'
description = 'Tech news'
oldest_article = 7
language = 'ja'
max_articles_per_feed = 100
no_stylesheets = True
use_embedded_content = True
feeds = [ (u'Posts', u'http://japanese.engadget.com/rss.xml')]
@font-face {
font-family: "Ryo Gothic";
font-weight: normal;
font-style: normal;
src: url(res:///abook/fonts/ryogothicplusnmedium.ttf);
}
megabadd is offline   Reply With Quote