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 01-25-2010, 05:16 PM   #1276
Over
Wizard
Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.
 
Over's Avatar
 
Posts: 1,462
Karma: 6061516
Join Date: May 2008
Location: Cascais, Portugal
Device: Kindle PW, Samsung Galaxy Note Pro 12.2", OnePlus 6
Ok, I've tried to add the feeds, but calibre gives an error qhen I try to load it:

Quote:
ERROR: Invalid input: <p>Could not create recipe. Error:<br>invalid syntax (recipe29.py, line 67)
Here's the ony part I changed:

Code:
    feeds = [
               (u'Breaking News', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=1')
              ,(u'Practice', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=512')
              ,(u'Behind the headlines', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=468')
              ,(u'Analysis', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=62')
              ,(u'Acute Care news', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=5')
              ,(u'Primary Care news', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=231')
              ,(u'Mental Health news', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=27')
              ,(u'Management news', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=32')
              ,(u'Infection control news', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=456')
              ,(u'Older people's news', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=181')
              ,(u'Paediatric news', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=170')
              ,(u'Respiratory news', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=177')
              ,(u'Wound care news', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=182')
              ,(u'Acute Care practice', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=261')
              ,(u'Primary Care practice', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=303')
              ,(u'Mental Health practice', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=319')
              ,(u'Infection control practice', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=400')
              ,(u'Older people's practice', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=365')
              ,(u'Paediatric practice', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=342')
              ,(u'Respiratory practice', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=416')
              ,(u'Wound care practice', u'http://www.nursingtimes.net/XmlServers/navsectionRSS.aspx?navsectioncode=377')
            ]
Is it because I've added too many feeds?
Over is offline  
Old 01-25-2010, 05:22 PM   #1277
Over
Wizard
Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.
 
Over's Avatar
 
Posts: 1,462
Karma: 6061516
Join Date: May 2008
Location: Cascais, Portugal
Device: Kindle PW, Samsung Galaxy Note Pro 12.2", OnePlus 6
Aha! I think I know what's the problem! One of the titles has an «'», so that section name must be between " instead of '.

You did it right the first time, but when I started to add feed, I though I had placed the " by mistake and changed to '.

Now calibre acepted the recipe and I'm fetching the news.
Over is offline  
Advert
Old 01-25-2010, 05:36 PM   #1278
Over
Wizard
Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.
 
Over's Avatar
 
Posts: 1,462
Karma: 6061516
Join Date: May 2008
Location: Cascais, Portugal
Device: Kindle PW, Samsung Galaxy Note Pro 12.2", OnePlus 6
Strange... It didn't sign in to get the feeds I've added, but it fetches the other feeds, although all of them need registering...

Please, help!

Last edited by Over; 01-25-2010 at 05:42 PM.
Over is offline  
Old 01-25-2010, 05:47 PM   #1279
evanmaastrigt
Connoisseur
evanmaastrigt doesn't litterevanmaastrigt doesn't litter
 
Posts: 78
Karma: 192
Join Date: Nov 2009
Device: Sony PRS-600
Quote:
Originally Posted by Over View Post
Aha! I think I know what's the problem! One of the titles has an «'», so that section name must be between " instead of '.
Just a tip: when you are editing recipes in calibre's GUI and you are not so comfortable with Python syntax: save your edits line by line. Or block by block in the case of 'if' or 'for' constructs. Line numbers are not visible in the recipe, and the line number the error gives will be off by 3, 2, or sometimes only 1 line anyway. If you do it line by line you will know immediately where to look.

Or do your editing in a Python syntax aware text editor. That would have flagged this error right on the spot.
evanmaastrigt is offline  
Old 01-25-2010, 06:26 PM   #1280
Over
Wizard
Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.Over ought to be getting tired of karma fortunes by now.
 
Over's Avatar
 
Posts: 1,462
Karma: 6061516
Join Date: May 2008
Location: Cascais, Portugal
Device: Kindle PW, Samsung Galaxy Note Pro 12.2", OnePlus 6
Problem solved! Sorry for so many posts in a row.

@evanmaastrigt: thanks for the tip.
Over is offline  
Advert
Old 01-25-2010, 06:35 PM   #1281
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 Over View Post
BTW, how do I include the little image you bundled with the recipe?
You cant. Only Kovid can add those images.

Quote:
Originally Posted by Over View Post
And one more question, maybe it's related to the one above: is it possible to change the default calibre image in the sections list?
No. You can, however, submit a feature request for that functionality.
kiklop74 is offline  
Old 01-25-2010, 10:05 PM   #1282
cix3
Member
cix3 began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Aug 2009
Device: Kindle 2
New recipe for JazzTimes
jazztimes.com

Code:
class jazztimes(BasicNewsRecipe):
    title = 'JazzTimes'
    __author__ = 'cix3'
    description = 'Widely regarded as the worlds leading jazz publication'
    timefmt = ' [%b %d, %Y]'

    oldest_article = 30
    max_articles_per_feed = 100
    no_stylesheets = True

    remove_tags = [dict(name='div', attrs={'id':['logo', 'comments', 'related_objects', 'inset module', 'footer', 'strip_control', 'header', 'navigation']}), dict(name='hr'), dict(name='img')]

    feeds = [
        ('jazztimes', 'http://jazztimes.com/feeds/all.rss')
            ]
Would love it if someone could create a recipe for the actual magazine!
http://jazztimes.com/issues/201002

Last edited by cix3; 01-25-2010 at 10:09 PM.
cix3 is offline  
Old 01-25-2010, 10:57 PM   #1283
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,897
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
This is an improved recipe for the Raleigh News & Observer.

It improves/replaces the existing News and Observer recipe.

Had to clean up some added features the paper added to their site. Icon included.
Attached Files
File Type: zip RaleighNewsandObserver.zip (1.7 KB, 167 views)
DoctorOhh is offline  
Old 01-26-2010, 11:38 AM   #1284
jpc66
Junior Member
jpc66 began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2010
Device: Aluratek Libre
Metro Montreal, The Montreal Gazette and an improved version of Discover Magazine

Hi All,

My apologies for the delay. I was really busy and didn't have the time to check the latest posts.

OK, here they are: Recipes for the newspaper Metro Montreal, The Gazette from Montreal and an improved version of Discover Magazine.

Regards,

JC
Attached Files
File Type: zip Recipes.zip (2.4 KB, 159 views)
jpc66 is offline  
Old 01-26-2010, 12:02 PM   #1285
andersent
Junior Member
andersent began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2009
Device: kindle
extracting links from common web page

Quote:
Originally Posted by kiklop74 View Post
You are able to do that. In fact all recipes do exactly that. The difference is the source of the links. It is either RSS feed (which is just an xml), or common html page.

In case of RSS feeds everything is more or less automated, custom programming is required for extracting links from common web page.

For an example of this just take a look at this page:

http://calibre-ebook.com/user_manual/news.html
Thanks. I've looked the link you provided above over (had seen it before actually and that's where I got the idea of being able to get feeds from links embedded on a common page instead of just having to specify the links in the rss <item> tags of an rss.xml file). However, i get a bit lost in all of the stuff that is being done and discussed in the help link you referenced. I assume, for example, that it's the new york times recipe example that you are referring to and I see it uses soup. But I'm not sure exactly how to translate this example to mine--for example when it uses a for each statement I think i need to do something similar but not sure exactly what. I am a programmer (.net vb and c#) but have never worked with python. I've looked through several parts of the manual on custom recipes and learning python, etc. I get some of it and have been able to do my own custom recipes for some basic rss feeds. But could you just get me started here on how I would get the feeds from the specific web page I referenced in my original post on this thread? Thanks!
andersent is offline  
Old 01-26-2010, 12:28 PM   #1286
Nic
Junior Member
Nic began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jan 2010
Device: Sony touch edition
Hi!

Is there a recipe for onionnew.com ? It would be fun to have this one.


Thank you!
Nic is offline  
Old 01-26-2010, 12:29 PM   #1287
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
You already have a recipe for The Onion
kiklop74 is offline  
Old 01-27-2010, 08:21 PM   #1288
Nic
Junior Member
Nic began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jan 2010
Device: Sony touch edition
ahhh yes, thank you!
Nic is offline  
Old 01-28-2010, 06:31 PM   #1289
Mitchellbooks
Junior Member
Mitchellbooks began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jan 2010
Device: Nook
Could you come up with a recipe for the Journal News?
Thanks
Mitchellbooks is offline  
Old 01-28-2010, 06:33 PM   #1290
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
How about a link to that site. I have no idea what journal news is or where its located.
kiklop74 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:13 AM.


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