Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 12-11-2012, 04:31 AM   #1
sk365
Junior Member
sk365 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Dec 2012
Device: Mac OS 10.8, Android Phone
Override 'calibre' as converted feed's author in modified recipe

Hi,

I am desperately trying to find out how to modify a recipe such that the I can set an arbitrary author of the feed instead of "calibre". Eg. I would like have appear 'FAZ' as the author of a converted news feed. Now when I take the pre-made FAZ rececpie below and insert

authors = 'FAZ'
conversion_options = { 'authors' : 'FAZ' }

the result is that calibre still figures as the epub author. Why?

Please help

Best wishes
Stefan



__license__ = 'GPL v3'
__copyright__ = '2008-2011, Kovid Goyal <kovid at kovidgoyal.net>, Darko Miletic <darko at gmail.com>'
'''
Profile to download FAZ.NET
'''

from calibre.web.feeds.news import BasicNewsRecipe

class FazNet(BasicNewsRecipe):
title = 'FAZ.NET_1'
authors = 'FAZ'
__author__ = 'Kovid Goyal, Darko Miletic'
description = 'Frankfurter Allgemeine Zeitung'
publisher = 'Frankfurter Allgemeine Zeitung GmbH'
category = 'news, politics, Germany'
use_embedded_content = False
language = 'de'

max_articles_per_feed = 30
no_stylesheets = True
encoding = 'utf-8'
remove_javascript = True
keep_only_tags = [{'class':'FAZArtikelEinleitung'},
{'id':'ArtikelTabContent_0'}]

feeds = [
('FAZ.NET Aktuell', 'http://www.faz.net/aktuell/?rssview=1'),
('Politik', 'http://www.faz.net/aktuell/politik/?rssview=1'),
('Wirtschaft', 'http://www.faz.net/aktuell/wirtschaft/?rssview=1'),
('Feuilleton', 'http://www.faz.net/aktuell/feuilleton/?rssview=1'),
#('Sport', 'http://www.faz.net/aktuell/sport/?rssview=1'),
('Gesellschaft', 'http://www.faz.net/aktuell/gesellschaft/?rssview=1'),
('Finanzen', 'http://www.faz.net/aktuell/finanzen/?rssview=1'),
('Technik & Motor', 'http://www.faz.net/aktuell/technik-motor/?rssview=1'),
('Wissen', 'http://www.faz.net/aktuell/wissen/?rssview=1'),
#('Reise', 'http://www.faz.net/aktuell/reise/?rssview=1'),
#('Beruf & Chance', 'http://www.faz.net/aktuell/beruf-chance/?rssview=1'),
#('Rhein-Main', 'http://www.faz.net/aktuell/rhein-main/?rssview=1') # AGe add 2012-07-13
]

conversion_options = { 'authors' : 'FAZ' }
sk365 is offline   Reply With Quote
Old 12-11-2012, 04:37 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,277
Karma: 4961457
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You cannot.
kovidgoyal is offline   Reply With Quote
Old 12-22-2012, 05:17 PM   #3
nickredding
onlinenewsreader.net
nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'
 
Posts: 318
Karma: 10143
Join Date: Dec 2009
Location: Phoenix, AZ & Victoria, BC
Device: Kindle 3, Kindle Fire, IPad3, iPhone4, Playbook, HTC Inspire
Here is a Python script to do that ...

Assuming you have Python installed on your machine, you can use the attached script to set the author field (EXTH 100) to whatever you like. Note that the author value should be enclosed in quotes if it contains embedded spaces. For example

set_author.py nyt.mobi "Sunday, December 22"

will set the author to today's date in the file nyt.mobi

There's not much in the way of error checking so if you give it a non-existent file it will just crash (harmlessly, of course).

UPDATE: I just noticed you are using EPUB. This only works for MOBI files. Sorry, I don't use EPUB myself so I don't have any script utilities to do this.

In case anyone is wondering why this might be useful for MOBI, when you read news files using the Kindle for iPad app there is no way to distinguish files with the same name but different publication dates. I use the author field to store the publication date since having "calibre" in all of the files as the author isn't very useful, but since the Kindle for iPad app displays the author and can sort by author, it allows me to see the publication date in the list view.
Attached Files
File Type: zip set_author.zip (2.1 KB, 27 views)

Last edited by nickredding; 12-22-2012 at 05:25 PM.
nickredding is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hint: How to override some imperfections of Calibre TMSxMR Library Management 0 07-16-2012 01:17 PM
Modified Recipe Tweakers.net - need help roedi06 Recipes 4 01-17-2012 07:42 AM
Recipe works when mocked up as Python file, fails when converted to Recipe ode Recipes 7 09-04-2011 04:57 AM
Modified Reuters News Recipe Submission rogerx Recipes 1 08-25-2011 10:19 PM
Modified Irish Times Recipe phiznlil Recipes 2 04-01-2011 06:27 AM


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


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