Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 03-07-2011, 07:15 AM   #1
chewi
Member
chewi has learned how to read e-bookschewi has learned how to read e-bookschewi has learned how to read e-bookschewi has learned how to read e-bookschewi has learned how to read e-bookschewi has learned how to read e-bookschewi has learned how to read e-books
 
chewi's Avatar
 
Posts: 14
Karma: 822
Join Date: Nov 2010
Device: sony prs-650
Arrow Built-in recipe for Computerra.ru (Компьютерра)

Unfortunetly, built-in recipe for Computerra.ru (Компьютерра) by Vadim Dyadkin is resulting epub that doesn't look good on my Sony PRS-650 – some articles are not visible, some are only partially. I've made tiny changes, now it works good for me (so, may be useful to someone else with such issue):

Spoiler:
#!/usr/bin/python
# -*- coding: utf-8 -*-

__license__ = 'GPL v3'
__copyright__ = '2010, Vadim Dyadkin, dyadkin@gmail.com'
__author__ = 'Vadim Dyadkin'

from calibre.web.feeds.news import BasicNewsRecipe

class Computerra(BasicNewsRecipe):
title = u'Computerra.ru'
oldest_article = 100
__author__ = 'Vadim Dyadkin (edited by A. Chewi)'
max_articles_per_feed = 50
use_embedded_content = False
remove_javascript = True
no_stylesheets = True
conversion_options = {'linearize_tables' : True}
simultaneous_downloads = 5
language = 'ru'
description = u'Компьютерра: все новости про компьютеры, железо, новые технологии, информационные технологии'

keep_only_tags = [dict(name='div', attrs={'id': 'content'}),]

feeds = [(u'Компьютерра-Онлайн', 'http://feeds.feedburner.com/ct_news/'),]

remove_tags = [
dict(name='div', attrs={'id': ['fin', 'idc-container', 'idc-noscript',]}),
dict(name='ul', attrs={'class': "related_post"}),
dict(name='p', attrs={'class': 'info'}),
dict(name='a', attrs={'class': 'twitter-share-button'}),
dict(name='a', attrs={'type': 'button_count'}),
dict(name='h2', attrs={})
]

def print_version(self, url):
return url + '?print=true'
Attached Files
File Type: txt computerra-ru.txt (1.3 KB, 143 views)

Last edited by chewi; 03-07-2011 at 09:47 AM.
chewi is offline   Reply With Quote
Reply


Forum Jump


All times are GMT -4. The time now is 07:32 PM.


MobileRead.com is a privately owned, operated and funded community.