Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 10-09-2008, 12:47 PM   #1
Acey
Member
Acey began at the beginning.
 
Posts: 19
Karma: 10
Join Date: Oct 2008
Device: Sony PRS-505
Question Help with news recipe

I'm having trouble getting the print versions of articles from the Orlando Sentinel. The problem is that they have completely different article numbers for the regular and print-friendly versions of a feature.

For instance:

In this RSS feed: http://feeds.feedburner.com/orlandosentinel

Regular version with the link provided in RSS: http://www.orlandosentinel.com/business/orl-existing-home-sales-orlando-100908,0,2581414.story

Print-friendly version (link is found on regular article's page): http://www.orlandosentinel.com/business/orl-existing-home-sales-orlando-100908,0,95752,print.story

The print-friendly version shows up like this in the regular version:
Code:
<div><img src="/common/images/icons/atools-printer.gif" alt="Print" /><a href="/business/orl-existing-home-sales-orlando-100908,0,95752,print.story" rel="nofollow" >Print</a></div>
What would be the best way to get the printable versions instead of the regular articles?

I already tried this but I think it's just looking at the actual RSS feed instead of each article so it did not help.
Code:
def print_version(self, url):
		soup = self.index_to_soup(url)
		for item in soup.findAll('a', attrs={'rel':'nofollow'}):
			strhref = item['href']
			match = strhref.find('print.story')
			if match > -1:
				return strhref
				
			return None
Thanks in advance for any help you can provide.
Acey is offline   Reply With Quote
Old 10-09-2008, 02:36 PM   #2
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: 26,125
Karma: 5381911
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Code:
def print_version(self, url):
    for a in self.index_to_soup(url).findAll('a', href=re.compile(r'print\.story'):
          if 'Print' in a.string:
                return 'http://www.orlandosentinel.com' + a['href']
    return url
kovidgoyal is online now   Reply With Quote
Old 03-12-2010, 06:36 AM   #3
gatorguy
Junior Member
gatorguy began at the beginning.
 
gatorguy's Avatar
 
Posts: 3
Karma: 10
Join Date: Mar 2010
Location: Oviedo, FL
Device: Kindle 2
Acey,

Were you able to get your recipe to work with the Orlando Sentinel?

Gatorguy
gatorguy is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Merging two news sources in same recipe cartesio Calibre 3 02-05-2012 04:05 PM
Catholic News Recipe Problem funkgut Calibre 4 04-23-2010 02:08 PM
News recipe sorting OzAz Calibre 3 10-30-2009 06:28 PM
Question on TheAtlantic News Recipe gilamon Calibre 6 11-05-2008 03:07 PM
The Times news recipe? AprilHare Calibre 1 10-10-2008 01:48 PM


All times are GMT -4. The time now is 11:07 PM.


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