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 07-12-2012, 11:56 PM   #1
us06154
Member
us06154 began at the beginning.
 
us06154's Avatar
 
Posts: 11
Karma: 10
Join Date: Jun 2012
Location: London, Ontario
Device: KOBO wi-fi
Series Tag

Is there a way to incorporate the "series" tag, into a basic recipe?

i.e.:

class dailymirror(BasicNewsRecipe):
cover_url = 'http://www.johnsilva.ca/covers/dmirrorcov.jpg'
title = u'Daily Mirror'
author = 'News Articles'
description = u"News Articles from Daily Mirror website"
-> series = 'News Articles'
oldest_article = 7
max_articles_per_feed = 100
auto_cleanup = True

feeds = [(u'Breaking News', u'http://www.dailymirror.lk/index.php?option=com_ninjarsssyndicator&feed_id=16 &format=raw'), (u'Technology', u'http://www.dailymirror.lk/index.php?option=com_ninjarsssyndicator&feed_id=15 &format=raw'), (u'World News', u'http://dmadmin.dailymirror.lk/index.php?option=com_ninjarsssyndicator&feed_id=12 &format=raw')]
us06154 is offline   Reply With Quote
Old 07-13-2012, 12:00 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: 45,255
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
conversion_options = {'series':'xxx', series_index: 2}
kovidgoyal is offline   Reply With Quote
Advert
Old 07-13-2012, 03:14 AM   #3
us06154
Member
us06154 began at the beginning.
 
us06154's Avatar
 
Posts: 11
Karma: 10
Join Date: Jun 2012
Location: London, Ontario
Device: KOBO wi-fi
Syntax Error?

Thanks Kovid,

I tried inserting the code, but when saving the recipe, it bails out with an error: (BTW, timefmt works,, thanks for the tip.)

class sundayLeader(BasicNewsRecipe):
cover_url = 'http://www.johnsilva.ca/covers/sleadercov.jpg'
title = u'Sunday Leader'
timefmt = ' [%Y, %m %d, %a]'
publisher = 'Sunday Leader'
conversion_options = {'series':'News Articles', series_index: 2}
description = u"News Articles from Sunday Leader Website"
oldest_article = 7
max_articles_per_feed = 100
auto_cleanup = True

feeds = [(u'News', u'http://www.thesundayleader.lk/feed/')]

=== Error ======
calibre, version 0.8.58
ERROR: Invalid input: <p>Could not create recipe. Error:<br>name 'series_index' is not defined
us06154 is offline   Reply With Quote
Old 07-13-2012, 04:06 AM   #4
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: 45,255
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You need quotes around series_index
kovidgoyal is offline   Reply With Quote
Old 07-13-2012, 06:46 AM   #5
us06154
Member
us06154 began at the beginning.
 
us06154's Avatar
 
Posts: 11
Karma: 10
Join Date: Jun 2012
Location: London, Ontario
Device: KOBO wi-fi
Thanks

Thanks Kovid,

It works now. I reran the job, and it produced the desired result (it had the correct series, but there was the number `2`beside it. ), was it because I had already run the job once before? and the DB was keeping track of the version?

If I may ask, What does the 2 in ( 'series_index': 2 ) for?

Thanks again for your kind assistance.
us06154 is offline   Reply With Quote
Advert
Old 07-13-2012, 06:49 AM   #6
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: 45,255
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The number of the book in the series.
kovidgoyal is offline   Reply With Quote
Old 07-15-2012, 01:26 AM   #7
us06154
Member
us06154 began at the beginning.
 
us06154's Avatar
 
Posts: 11
Karma: 10
Join Date: Jun 2012
Location: London, Ontario
Device: KOBO wi-fi
A bit puzzled

Not sure if this is exactly what I was expecting.. I placed quotes around the tag:

Code:
class dailymirror(BasicNewsRecipe):
    cover_url             = 'http://www.johnsilva.ca/covers/dmirrorcov.jpg'
    title          = u'Daily Mirror'
    timefmt = ' [%Y, %m %d, %a]'
    publisher = 'News Articles'
    conversion_options = {'series':'News Articles', 'series_index': 2}
    description		        = u"News Articles from Daily Mirror website"
    language = 'en'
    encoding              = 'utf-8'
    oldest_article = 7
    max_articles_per_feed = 100
    auto_cleanup = True

    feeds          = [(u'Breaking News', u'http://www.dailymirror.lk/index.php?option=com_ninjarsssyndicator&feed_id=16&format=raw'), (u'Technology', u'http://www.dailymirror.lk/index.php?option=com_ninjarsssyndicator&feed_id=15&format=raw'), (u'World News', u'http://dmadmin.dailymirror.lk/index.php?option=com_ninjarsssyndicator&feed_id=12&format=raw')]
And I get the following output:


Should the items under "series"[2] increment? or what exactly is the [2]?
us06154 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tag browser Series hierarchy Dopedangel Library Management 4 06-15-2012 06:20 AM
any way to create a tag from the series field? booklover81 Calibre 0 12-19-2011 02:11 PM
Adding an Owner tag to tag list? Fangles Library Management 1 02-25-2011 02:32 AM
Tag Browser & Series oldbwl Calibre 7 10-06-2010 04:58 PM
Pet peeve: series authors who introduce things in non-series books! ficbot Reading Recommendations 12 02-06-2010 02:14 AM


All times are GMT -4. The time now is 06:30 PM.


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