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 07-26-2009, 01:42 AM   #616
OnwardAhead
Junior Member
OnwardAhead began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Mar 2009
Location: Kenya
Device: Kindle DX
Am trying to run a test with the ForeignPolicy.com main feed. Have tried a number of variations, and think that this following snippet would be closest to what I want to get, but no love.

Code:
class AdvancedUserRecipe1248523694(BasicNewsRecipe):
    title          = u'Foreign Policy Test'
    oldest_article = 15
    max_articles_per_feed = 100
    keep_only_tags = [dict(name='div', attrs={'id':'art-mast'}),dict(name='div', attrs={'id':'art-body'})]

    feeds          = [(u'Main', u'http://www.foreignpolicy.com/node/feed')]

    def print_version(self, url):
        return url + '?print=yes&hidecomments=yes&page=full'
Not sure if my syntax is off, but I continually get 'IndexError: list index out of range' (see attached logs).

Any thoughts?
Attached Files
File Type: txt testlog.txt (44.0 KB, 348 views)
OnwardAhead is offline  
Old 07-26-2009, 01:53 AM   #617
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,377
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That's a weird set of errors. Off the top of my head I'd say the pages being downloaded are not even HTML

The IndexErrors basically come from finding no html tags in the files
kovidgoyal is offline  
Old 07-26-2009, 11:56 PM   #618
amerryman
Reader Newb
amerryman began at the beginning.
 
amerryman's Avatar
 
Posts: 7
Karma: 10
Join Date: Jul 2009
Location: Las Vegas, Nv
Device: PRS505
Thanks Kovid -

Okay just to be sure I re-read the FAQ and didn't see anything there about this maybe you can shed some light. Is there a way to (BESIDES creating a custom feed for each one) adjust the tags that are associated with recipes?

For instance instead of having each one tagged as news AND the title ie: under collections I have 8 news and each one self titled Washington Post, Engadget, etc.. is there a easy way of omitting the Self Title and just tagging it as News for the Collections?

Last edited by amerryman; 07-26-2009 at 11:57 PM. Reason: spelling
amerryman is offline  
Old 07-27-2009, 01:43 AM   #619
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,377
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Not at the moment
kovidgoyal is offline  
Old 07-27-2009, 10:14 AM   #620
joxxon
Junior Member
joxxon began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jul 2009
Device: prs-505
Anyone done the http://www.dn.se

I would really love to be able to read the swedish news paper Dagens Nyheter on my prs-505. Anyone that have cocked this one?

www.dn.se

feeds:

http://www.dn.se/toppnyheter-rss
http://www.dn.se/ekonomi-rss
http://www.dn.se/sport-rss
http://www.dn.se/debatt-rss
http://www.dn.se/ledare-rss
http://www.dn.se/kultur-rss

BTW, Im running a news website (free and add free so this is not a pitch ) that collects news feeds from various news papers etc. Everything from CNN to BBC. Its designed for mobile devices. Feel free to have a look.

http://getnews.mine.nu
joxxon is offline  
Old 07-27-2009, 04:36 PM   #621
samgler
Junior Member
samgler began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Feb 2009
Device: non
Collection of Thai Newspapers.

http://www.norsorpor.com/chooseRSS.php

I browse within each category, news are there. However, I cannot make them to LRFs.

My codes are:
Code:
class AdvancedUserRecipe1248726179(BasicNewsRecipe):
    title          = u'NorSorPor'
    oldest_article = 7
    max_articles_per_feed = 100
    encoding              = 'utf_8'
    no_stylesheets        = True
    use_embedded_content  = False
    remove_javascript     = True

    remove_tags     = [dict(name='td', attrs={'align':'right'})]
    remove_tags     = [dict(name='td', attrs={'align':'left'})]

    html2lrf_options = ['--ignore-tables']
    html2epub_options = 'linearize_tables = True'

    feeds          = [
(u'Hot News', u'http://www.norsorpor.com/rss.php?category=1'), 
(u'Business', u'http://www.norsorpor.com/rss.php?category=3'), 
(u'Entertainment', u'http://www.norsorpor.com/rss.php?category=4'), 
(u'Around The World', u'http://www.norsorpor.com/rss.php?category=5'), 
(u'Sports', u'http://www.norsorpor.com/rss.php?category=6'), 
(u'Technology', u'http://www.norsorpor.com/rss.php?category=9'), 
(u'Premiere League', u'http://www.norsorpor.com/rss.php?category=21')
                         ]
Each category will have its own blank page with only the title inside. Am I missing something? TIA

Last edited by samgler; 07-27-2009 at 04:40 PM.
samgler is offline  
Old 07-28-2009, 12:31 AM   #622
ssimon2000
Member
ssimon2000 began at the beginning.
 
Posts: 20
Karma: 32
Join Date: Jan 2009
Device: Sony 700
Has anyone developed a recipe for Our Daily Bread? The website is http://www.rbc.org/odb/odb.shtml, and the RSS feed is http://www.rbc.org/rss.ashx?id=50398.
I've tried loading the RSS address into a custom news source, but all I get is a title page...

Thanks!
ssimon2000 is offline  
Old 07-28-2009, 05:38 PM   #623
cartesio
Member
cartesio began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jul 2009
Device: kindle 2
Please help me with a recipe for Project Syndicate:
http://www.project-syndicate.org
http://www.project-syndicate.org/about_us/rss

Thanks!
cartesio is offline  
Old 07-29-2009, 04:20 AM   #624
OnwardAhead
Junior Member
OnwardAhead began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Mar 2009
Location: Kenya
Device: Kindle DX
RE: threads #616/617

On the Foreign Policy feeds, very odd. Initially I thought there may have been an issue due to the javascript embedded in the print-friendly URLS. That said, if you try the feed direct, without rewriting the links (as my example did), you still get the same errors.

Has anyone tried this off of the ForeignPolicy Main feed (http://www.foreignpolicy.com/node/feed)?? Does not seem to be a problem with their other feeds. Would really like to get this working so any input is appreciated.

Cheers
OnwardAhead is offline  
Old 07-29-2009, 07:28 AM   #625
scwehrl
Member
scwehrl began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Nov 2008
Device: prs505
Newsweek parse error

Seems that after upgrade to 6.0 the first couple of times I downloaded Newsweek it worked fine, now get the attached parse error. Something on my end? Windows Vista 32bit. Thanks for any help.
Attached Files
File Type: txt NewsweekParseError.txt (15.9 KB, 295 views)
scwehrl is offline  
Old 07-29-2009, 12:10 PM   #626
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,377
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Yeah newsweek started embedding some invalid XML content that is causing that error. Will be fixed in the next release.
kovidgoyal is offline  
Old 07-30-2009, 02:03 PM   #627
dieterpops
Addict
dieterpops can bend spoons with a thought.dieterpops can bend spoons with a thought.dieterpops can bend spoons with a thought.dieterpops can bend spoons with a thought.dieterpops can bend spoons with a thought.dieterpops can bend spoons with a thought.dieterpops can bend spoons with a thought.dieterpops can bend spoons with a thought.dieterpops can bend spoons with a thought.dieterpops can bend spoons with a thought.dieterpops can bend spoons with a thought.
 
Posts: 261
Karma: 134567
Join Date: Nov 2008
Device: Always in flux
Star Tribune

I would like to get a recipe for the Minneapolis Star Tribune. Thanks!
dieterpops is offline  
Old 07-30-2009, 10:07 PM   #628
scwehrl
Member
scwehrl began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Nov 2008
Device: prs505
Newsweek + 0.6.3 = perfect

Thanks very much Kovid
scwehrl is offline  
Old 07-31-2009, 01:05 AM   #629
Krapmeister
Junior Member
Krapmeister began at the beginning.
 
Krapmeister's Avatar
 
Posts: 6
Karma: 10
Join Date: Jul 2009
Location: Adelaide, Australia
Device: Hanlin V3
If anyone with advanced recipe knowledge can do a recipe for http://www.mcsweeneys.net/ I'd appreciate it.

Basic mode gets the content but also pages and pages of links to archive content which isn't in the feed.

The site adds about 10 items every day so a recipe that get's the most recent 30 would suit me, and then I can just schedule it for every 3 days.

Thanks

K
Krapmeister is offline  
Old 08-01-2009, 01:51 PM   #630
hackettt
Enthusiast
hackettt is on a distinguished road
 
hackettt's Avatar
 
Posts: 31
Karma: 58
Join Date: Nov 2008
Device: Sony 505
Kovid and Darko —

I am not skilled in recipes, and I believe I am doing something incorrect. What I wish to do is edit the UK papers' recipes to omit all categories except sport. (I am cricket and football fan living in the States.) However, when I try to edit the recipes, Calibre does not download anything. I first tried this with the Daily Mail to no success.

Is there something I must do besides eliminating the code for other sections I do not want?

This is what I reduced the code to:

from calibre.web.feeds.news import BasicNewsRecipe

class TheDailyMail(BasicNewsRecipe):
title = u'The Daily Mail'
oldest_article = 2
language = _('English')
author = 'RufusA'
simultaneous_downloads= 1
max_articles_per_feed = 50

extra_css = 'h1 {text-align: left;}'

remove_tags = [ dict(name='ul', attrs={'class':'article-icons-links'}) ]
remove_tags_after = dict(name='h3', attrs={'class':'social-links-title'})
remove_tags_before = dict(name='div', attrs={'id':'content'})
no_stylesheets = True

feeds = [
(u'Sport', u'http://www.dailymail.co.uk/sport/index.rss')]

def print_version(self, url):
main = url.partition('?')[0]
return main + '?printingPage=true'

However, nothing occurs when I try to download the information.

Thanks. Cheers.
hackettt 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 08:32 AM.


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