View Single Post
Old 03-25-2010, 10:19 PM   #2
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by EnergyLens View Post
Are there any examples using the CustomIndexRecipe class?

I have heaps of web content that I've downloaded using the Firefox Scrapbook plug-in and I want to use Calibre's ebook-convert command line tool to mass-edit them but can't quite figure out how to use CustomIndexRecipe.custom_index()

There don't seem to be any examples of this anywhere?

Thanks
I assume you've read this:
Quote:
CustomIndexRecipe¶
class calibre.web.feeds.news.CustomIndexRecipe¶
This class is useful for getting content from websites that don’t follow the “multiple articles in several feeds” content model.

CustomIndexRecipe.custom_index()¶
Return the filesystem path to a custom HTML document that will serve as the index for this recipe. The index document will typically contain many <a href=”...”> tags that point to resources on the internet that should be downloaded.
I've also noticed the dearth of examples. No built-in recipes use it. What have you tried? It looks fairly straight forward. Just guessing, but I'd try using the CustomIndexRecipe in your class and then:
Code:
def custom_index(self):
    filepath = path_to_custom_index.html
    return filepath
I have my doubts that this is going to be very successful, but I suppose it depends on what's in your index. Maybe Kovid will comment. Let us know what you find out.
Starson17 is offline   Reply With Quote