View Single Post
Old 04-18-2009, 09:05 AM   #451
ax42
Member
ax42 began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Apr 2009
Location: Switzerland
Device: PRS505
Zurich cinema

Hi,

I'm trying to build a recipe for the following page which lists the current films showing in the Zurich cinemas:

http://www.kulturinfo.ch/kino/db_front/showact.php

Each link goes to a description of the film. I would like to end up with an ebook where the films are the "Chapters".

So far I have the following code:

Code:
#!/usr/bin/env  python
# vim:et:sts:sw=4:sts=4
# Last modified: 2009 Apr 18
"""
zhkimo
"""
import string, re
from calibre import strftime
from calibre.web.feeds.recipes import BasicNewsRecipe
from calibre.ebooks.BeautifulSoup import BeautifulSoup

class zhkino(BasicNewsRecipe):

    title = "Zurich Cinema"
    __author__ = "Alexis Iglauer"
    description = "Weekly Cinema listing for Zurich"
    index = 'http://www.kulturinfo.ch/kino/db_front/showact.php'
    #remove_tags_before = dict(name='div', id='storytop')
    #remove_tags        = [dict(name='div', id=['seealso', 'storybottom', 'footer', 'ad_banner_top', 'sidebar'])]
    no_stylesheets     = True
    #feeds          = [ ('News Front Page', 'http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml')] 


    def parse_index(self):
        return [('axtst',{'title':'T', 'date':'D', 'url',"U", 'description':"D"})]
As you can see, I am commenting out a few things to get a handle on the error I am getting:
Code:
ax@shiny:/pub/Books/tmp/t$ feeds2disk --debug --test zhkino.py 
Traceback (most recent call last):
  File "/Applications/Tools/calibre.app/Contents/Resources/loaders/feeds2disk.py", line 9, in <module>
    main()
  File "/Applications/Tools/calibre.app/Contents/Resources/lib/python2.6/site-packages.zip/calibre/web/feeds/main.py", line 164, in main
  File "/Applications/Tools/calibre.app/Contents/Resources/lib/python2.6/site-packages.zip/calibre/web/feeds/main.py", line 135, in run_recipe
  File "calibre/web/feeds/recipes/__init__.pyo", line 106, in compile_recipe
  File "/var/folders/QO/QONZvFNdEi0MpoGeGOCCBk+++TI/-Tmp-/calibre_0.5.7__c2R1d_recipes/recipe1.py", line 5, in <module>
    zhkino.py
NameError: name 'zhkino' is not defined
BTW this is on OS X with calibre 0.5.7. Any pointers would be much appreciated.

Kind regards
Alexis
ax42 is offline