Register Guidelines E-Books Today's Posts Search

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

Notices

Closed Thread
 
Thread Tools Search this Thread
Old 04-16-2009, 06:48 PM   #436
pghaworth
Fervent Pleasure Seeker
pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.
 
pghaworth's Avatar
 
Posts: 1,224
Karma: 712073
Join Date: Feb 2009
Location: The Windmills of My Mind
Device: Clara HD
Does anyone have a recipe for The Seattle Times? I did as much as I could but then got confused. Any and all help appreciated.

http://seattletimes.nwsource.com/html/home/index.html
pghaworth is offline  
Old 04-16-2009, 10:26 PM   #437
kiklop74
Guru
kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.
 
kiklop74's Avatar
 
Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
New recipe for Seattle Times:
Attached Files
File Type: zip seattle_times.zip (1.3 KB, 211 views)
kiklop74 is offline  
Advert
Old 04-17-2009, 10:58 AM   #438
laborg
Zealot
laborg has top level security clearance to Area 51.laborg has top level security clearance to Area 51.laborg has top level security clearance to Area 51.laborg has top level security clearance to Area 51.laborg has top level security clearance to Area 51.laborg has top level security clearance to Area 51.laborg has top level security clearance to Area 51.laborg has top level security clearance to Area 51.laborg has top level security clearance to Area 51.laborg has top level security clearance to Area 51.laborg has top level security clearance to Area 51.
 
Posts: 105
Karma: 94000
Join Date: Oct 2007
Location: Vienna
Device: Cybook Gen3
Learned a thing or two from kiklop74 and updated derstandard recipe:
Attached Files
File Type: zip derstandard_ger.zip (3.4 KB, 223 views)
laborg is offline  
Old 04-17-2009, 11:09 AM   #439
pghaworth
Fervent Pleasure Seeker
pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.
 
pghaworth's Avatar
 
Posts: 1,224
Karma: 712073
Join Date: Feb 2009
Location: The Windmills of My Mind
Device: Clara HD
Quote:
Originally Posted by kiklop74 View Post
New recipe for Seattle Times:
You rock! TY
pghaworth is offline  
Old 04-17-2009, 01:57 PM   #440
pghaworth
Fervent Pleasure Seeker
pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.
 
pghaworth's Avatar
 
Posts: 1,224
Karma: 712073
Join Date: Feb 2009
Location: The Windmills of My Mind
Device: Clara HD
Quote:
Originally Posted by kiklop74 View Post
New recipe for Seattle Times:
It is abundantly clear that I have no idea how to use this file. I opened it and copied the recipe into Calibre, saved it and asked it to download. The only thing that happened is a big error screen. Am I supposed to move or copy the files somewhere. I am a real noob with this stuff. Apologies.


Job: **Fetch news from Seattle Times**
**tuple**: ('NotImplementedError', u'')
**Traceback**:
Traceback (most recent call last):
File "parallel.py", line 958, in worker
File "parallel.py", line 916, in work
File "C:\Calibre\library.zip\calibre\ebooks\mobi\from_f eeds.py", line 69, in main
File "C:\Calibre\library.zip\calibre\ebooks\mobi\from_f eeds.py", line 42, in convert
File "C:\Calibre\library.zip\calibre\web\feeds\main.py" , line 152, in run_recipe
File "calibre\web\feeds\news.pyo", line 567, in download
File "calibre\web\feeds\news.pyo", line 695, in build_index
File "calibre\web\feeds\news.pyo", line 979, in parse_feeds
File "calibre\web\feeds\news.pyo", line 275, in get_feeds
NotImplementedError

**Log**:
('NotImplementedError', u'')
Traceback (most recent call last):
File "parallel.py", line 958, in worker
File "parallel.py", line 916, in work
File "C:\Calibre\library.zip\calibre\ebooks\mobi\from_f eeds.py", line 69, in main
File "C:\Calibre\library.zip\calibre\ebooks\mobi\from_f eeds.py", line 42, in convert
File "C:\Calibre\library.zip\calibre\web\feeds\main.py" , line 152, in run_recipe
File "calibre\web\feeds\news.pyo", line 567, in download
File "calibre\web\feeds\news.pyo", line 695, in build_index
File "calibre\web\feeds\news.pyo", line 979, in parse_feeds
File "calibre\web\feeds\news.pyo", line 275, in get_feeds
NotImplementedError

Last edited by pghaworth; 04-17-2009 at 02:00 PM.
pghaworth is offline  
Advert
Old 04-17-2009, 02:28 PM   #441
pghaworth
Fervent Pleasure Seeker
pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.
 
pghaworth's Avatar
 
Posts: 1,224
Karma: 712073
Join Date: Feb 2009
Location: The Windmills of My Mind
Device: Clara HD
No worries, I think I figured it out. I'll be back if there's still a problem.
pghaworth is offline  
Old 04-17-2009, 02:32 PM   #442
kiklop74
Guru
kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.
 
kiklop74's Avatar
 
Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
See images:









Attached Thumbnails
Click image for larger version

Name:	snap1.png
Views:	691
Size:	47.6 KB
ID:	27671   Click image for larger version

Name:	snap2.png
Views:	704
Size:	41.9 KB
ID:	27672   Click image for larger version

Name:	snap3.png
Views:	719
Size:	29.7 KB
ID:	27673   Click image for larger version

Name:	snap4.png
Views:	727
Size:	42.1 KB
ID:	27674   Click image for larger version

Name:	snap5.png
Views:	702
Size:	29.6 KB
ID:	27675  
kiklop74 is offline  
Old 04-17-2009, 03:39 PM   #443
pghaworth
Fervent Pleasure Seeker
pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.
 
pghaworth's Avatar
 
Posts: 1,224
Karma: 712073
Join Date: Feb 2009
Location: The Windmills of My Mind
Device: Clara HD
Thank you. It's a beautiful thing. Once I figured out what to do with the file it worked perfectly. I'm still learning Calibre and all the things it can do but wow! Your help was a blessing. Thanks again.
pghaworth is offline  
Old 04-17-2009, 03:41 PM   #444
pghaworth
Fervent Pleasure Seeker
pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.pghaworth ought to be getting tired of karma fortunes by now.
 
pghaworth's Avatar
 
Posts: 1,224
Karma: 712073
Join Date: Feb 2009
Location: The Windmills of My Mind
Device: Clara HD
Sorry, one question. What, if anything, do I do with the icon that came with the py file? I couldn't figure out where to load it. It's really unimportant in the scheme of things but you included it so there must be a reason.
pghaworth is offline  
Old 04-17-2009, 03:58 PM   #445
Derry
Member
Derry began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Aug 2008
Device: Sony PRS505
Recipe only returns first page of multipage article.

Hi,
I'm trying to create a custom NYTimes global edition to replace the old IHT recipe. I've adapted as much formatting as I could from the NY Times recipe, but I can't get it to fetch multipage articles. Any help would be great.

I've only added a single feed so far, will add more once I can do multipage,

Thanks in advance,
Derry

Recipe is as follows:
Code:
class AdvancedUserRecipe1239810597(BasicNewsRecipe):
    title          = u'iht test'
    oldest_article = 7
    max_articles_per_feed = 100
    remove_tags_before = dict(id='article')
    remove_tags_after  = dict(id='article')
    remove_tags = [dict(attrs={'class':['articleTools', 'post-tools', 'side_tool', 'nextArticleLink clearfix']}), 
                   dict(id=['footer', 'toolsRight', 'articleInline', 'navigation', 'archive', 'side_search', 'blog_sidebar', 'side_tool', 'side_index']), 
                   dict(name=['script', 'noscript', 'style'])]
    encoding = 'cp1252'
    no_stylesheets = True
    extra_css = 'h1 {font: sans-serif large;}\n.byline {font:monospace;}'

    feeds          = [(u'iht front', u'http://www.nytimes.com/services/xml/rss/nyt/GlobalHome.xml')]
Derry is offline  
Old 04-17-2009, 04:22 PM   #446
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,398
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
try using the print version of the articles, since those will be single page
kovidgoyal is offline  
Old 04-17-2009, 08:00 PM   #447
kiklop74
Guru
kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.
 
kiklop74's Avatar
 
Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
Quote:
Originally Posted by pghaworth View Post
Sorry, one question. What, if anything, do I do with the icon that came with the py file? I couldn't figure out where to load it. It's really unimportant in the scheme of things but you included it so there must be a reason.
Icon is not for you. It is for Kovid, so when he includes new recipe into calibre he can assign it appropriate icon.
kiklop74 is offline  
Old 04-18-2009, 04:32 AM   #448
laborg
Zealot
laborg has top level security clearance to Area 51.laborg has top level security clearance to Area 51.laborg has top level security clearance to Area 51.laborg has top level security clearance to Area 51.laborg has top level security clearance to Area 51.laborg has top level security clearance to Area 51.laborg has top level security clearance to Area 51.laborg has top level security clearance to Area 51.laborg has top level security clearance to Area 51.laborg has top level security clearance to Area 51.laborg has top level security clearance to Area 51.
 
Posts: 105
Karma: 94000
Join Date: Oct 2007
Location: Vienna
Device: Cybook Gen3
Updated the "die_presse" recipe (+icon).

btw.: thank you, kovidgoyal, for your extraordinary work!
Attached Files
File Type: zip diepresse_ger.zip (1.7 KB, 184 views)
laborg is offline  
Old 04-18-2009, 04:37 AM   #449
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,398
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by laborg View Post
Updated the "die_presse" recipe (+icon).

btw.: thank you, kovidgoyal, for your extraordinary work!
You're most welcome
kovidgoyal is offline  
Old 04-18-2009, 06:24 AM   #450
redp
Junior Member
redp began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Apr 2009
Device: none
news feed to text file recipe

Dear All,

I am new to the forum but I think I searched pretty good for anything related and found nothing close to the answer, so please do not humiliate me if I missed something obvious.

I would like the news articles to be fetched from RSS and stored in txt format, all in one file. I am playing with Calibre for some time now, and appreciate the flexibility of the tool very much, but I am ground zero in python unfortunately.

Below is how far I got so far on the subject, if anyone could advance, or give any suggestions, or tell me if I am going in the wrong direction, please do.
The best option is ofcourse a sample recipe, but I think it is too much to ask for...

Thanks a lot in advance,
Redp

how far I got:
1. So I understand that I need to find a tag name identifying the main body of text in a specific newspaper. For one newspaper, it is div class="text", for example.
2. Then I shall use the keep_only_tags thing to have only that text in the html stored.
3. Then I suspect I need to redefine the preprocess_html and inside it somehow make use of tag_to_string to have only plain text stored.
4. Finally, I have to concat all the kind-of "html" into one file -- the txt file having all news in plain txt inside.

Huh, I managed to write a very simple recipe to account for items 1 and 2, but I have no idea if items 3 and 4 are a good plan. Even if it is a good plan, I feel so miserable because I do not understand python...
redp is offline  
Closed Thread


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom column read ? pchrist7 Calibre 2 10-04-2010 02:52 AM
Archive for custom screensavers sleeplessdave Amazon Kindle 1 07-07-2010 12:33 PM
How to back up preferences and custom recipes? greenapple Calibre 3 03-29-2010 05:08 AM
Donations for Custom Recipes ddavtian Calibre 5 01-23-2010 04:54 PM
Help understanding custom recipes andersent Calibre 0 12-17-2009 02:37 PM


All times are GMT -4. The time now is 04:28 PM.


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