|
|||||||
|
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community today, you will have fewer ads, access to post topics, communicate privately with other members, respond to polls, upload content and access many other special features. If you have any problems with the registration process or your account login, please contact us. Hint: Don't have time to visit us daily? Subscribe to our main RSS feed to receive our frontpage posts at your convenience. |
| Calibre New! Calibre is an open-source library manager to view, convert and catalog e-books. Cross-platform (Linux, Windows and OS X) |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
Addict
![]() ![]() ![]() ![]() ![]()
Posts: 274
Karma: 493
Join Date: Apr 2008
Device: Sony Reader PRS-500
|
Request: New Scientist recipe
Hello,
I'd very much like a working recipe for New Scientist magazine from the RSS feeds here. I tried applying the feeds directly in calibre for a simple recipe however I end up with LRF files with nothing in them. It's a major magazine and it'd make a great addition to the calibre recipe collection. |
|
|
|
|
|
#2 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]()
Posts: 308
Karma: 516
Join Date: Dec 2007
Location: Argentina
Device: Palm Tx, Sony PRS-505
|
Here goes:
Code:
#!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
'''
newscientist.com
'''
from calibre.web.feeds.news import BasicNewsRecipe
class Newscientist(BasicNewsRecipe):
title = u'New Scientist - Online News'
__author__ = 'Darko Miletic'
description = 'News from Science'
oldest_article = 7
max_articles_per_feed = 100
no_stylesheets = True
use_embedded_content = False
keep_only_tags = [
dict(name='div' , attrs={'id':'pgtop' })
,dict(name='div' , attrs={'id':'maincol' })
]
remove_tags = [
dict(name='div' , attrs={'class':'hldBd' })
,dict(name='div' , attrs={'id':'compnl' })
,dict(name='div' , attrs={'id':'artIssueInfo' })
]
feeds = [
(u'Latest Headlines' , u'http://feeds.newscientist.com/science-news' )
,(u'Magazine' , u'http://www.newscientist.com/feed/magazine' )
,(u'Health' , u'http://www.newscientist.com/feed/view?id=2&type=channel' )
,(u'Life' , u'http://www.newscientist.com/feed/view?id=3&type=channel' )
,(u'Space' , u'http://www.newscientist.com/feed/view?id=6&type=channel' )
]
|
|
|
|
|
|
#3 |
|
Addict
![]() ![]() ![]() ![]() ![]()
Posts: 274
Karma: 493
Join Date: Apr 2008
Device: Sony Reader PRS-500
|
She works! (Is code male, female or neuter?) Thankyou!
|
|
|
|
|
|
#4 |
|
Creator of calibre, Ph.D.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
Posts: 7,216
Karma: 20001
Join Date: Oct 2006
Location: Albuquerque, NM
Device: PRS-500/505/700, K2, BeBook
|
Definitely female considering the amount of time I spend staring at her
__________________
Get calibre |
|
|
|
|
|
#5 | |
|
Addict
![]() ![]() ![]() ![]() ![]()
Posts: 274
Karma: 493
Join Date: Apr 2008
Device: Sony Reader PRS-500
|
Quote:
Sample attached. Just don't mention this to your wife and everything will be OK
Last edited by AprilHare; 11-11-2008 at 06:33 PM. Reason: clarification |
|
|
|
|
|
|
#6 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]()
Posts: 308
Karma: 516
Join Date: Dec 2007
Location: Argentina
Device: Palm Tx, Sony PRS-505
|
|
|
|
|
|
|
#7 | |
|
Creator of calibre, Ph.D.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
Posts: 7,216
Karma: 20001
Join Date: Oct 2006
Location: Albuquerque, NM
Device: PRS-500/505/700, K2, BeBook
|
Quote:
__________________
Get calibre |
|
|
|
|
|
|
#8 |
|
Addict
![]() ![]() ![]() ![]() ![]()
Posts: 274
Karma: 493
Join Date: Apr 2008
Device: Sony Reader PRS-500
|
|
|
|
|
|
|
#9 |
|
Member
![]()
Posts: 13
Karma: 10
Join Date: Aug 2008
Device: Sony PRS505
|
Thanks so much for the feed, much appreciated
|
|
|
|
|
|
#10 |
|
Enthusiast
![]()
Posts: 42
Karma: 30
Join Date: Oct 2008
Device: Sony PRS-505
|
Can someone explain to me how to use this code? I'm new to the e-book world and have no idea what a "feed" is or any of the other stuff in this thread. Does this allow you to view New Scientist Magazine on your Sony E-Reader? Please help, I'm lost...
Edit: Never mind. I saw the "fetch news" tab at the top and New Scientist is listed as a perodical. I'm downloading it now and I assume I'll just have to upload it to my ereader and that should be it. Last edited by Ler0y Jenkins; 11-24-2008 at 08:54 AM. |
|
|
|
|
|
#11 | |
|
Addict
![]() ![]() ![]() ![]() ![]()
Posts: 274
Karma: 493
Join Date: Apr 2008
Device: Sony Reader PRS-500
|
Quote:
As Wikipedia puts it, "RSS is a family of Web feed formats used to publish frequently updated works—such as blog entries, news headlines, audio, and video—in a standardized format." In this case, featured New Scientist articles. It is doubtful you would get full articles that NewScientist.com requires you to buy a subscription to view, however. They've got to give us encouragement to pay somehow!
Last edited by AprilHare; 11-24-2008 at 09:33 AM. Reason: Clarification |
|
|
|
|
|
|
#12 |
|
Addict
![]() ![]() ![]() ![]() ![]()
Posts: 274
Karma: 493
Join Date: Apr 2008
Device: Sony Reader PRS-500
|
Here is an improvement: a few more feeds added:
Code:
#!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>, AprilHare'
'''
newscientist.com
'''
from calibre.web.feeds.news import BasicNewsRecipe
class Newscientist(BasicNewsRecipe):
title = u'New Scientist - Online News'
__author__ = 'Darko Miletic'
description = 'News from Science'
oldest_article = 7
max_articles_per_feed = 100
no_stylesheets = True
use_embedded_content = False
keep_only_tags = [
dict(name='div' , attrs={'id':'pgtop' })
,dict(name='div' , attrs={'id':'maincol' })
]
remove_tags = [
dict(name='div' , attrs={'class':'hldBd' })
,dict(name='div' , attrs={'id':'compnl' })
,dict(name='div' , attrs={'id':'artIssueInfo' })
]
feeds = [
(u'Latest Headlines' , u'http://feeds.newscientist.com/science-news' )
,(u'Magazine' , u'http://www.newscientist.com/feed/magazine' )
,(u'Health' , u'http://www.newscientist.com/feed/view?id=2&type=channel' )
,(u'Life' , u'http://www.newscientist.com/feed/view?id=3&type=channel' )
,(u'Space' , u'http://www.newscientist.com/feed/view?id=6&type=channel' )
,(u'Physics and Mathematics' , u'http://www.newscientist.com/feed/view?id=4&type=channel' )
,(u'Environment' , u'http://www.newscientist.com/feed/view?id=1&type=channel' )
,(u'Science in Society' , u'http://www.newscientist.com/feed/view?id=5&type=channel' )
,(u'Tech' , u'http://www.newscientist.com/feed/view?id=7&type=channel' )
]
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| recipe editing | alexxxm | Calibre | 1 | 10-31-2008 11:42 AM |
| Help with news recipe | Acey | Calibre | 1 | 10-09-2008 02:36 PM |
| Newsweek Recipe | SnafuRacer | Calibre | 5 | 07-07-2008 02:35 PM |
| Dual display navigation - New Scientist article | ePossum | News and Commentary | 37 | 06-30-2008 04:42 AM |
| How to rewrite New Scientist links | pingtiao | Sunrise | 3 | 02-05-2007 05:50 PM |