Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 02-12-2013, 04:38 PM   #1
munkymack
Junior Member
munkymack ought to be getting tired of karma fortunes by now.munkymack ought to be getting tired of karma fortunes by now.munkymack ought to be getting tired of karma fortunes by now.munkymack ought to be getting tired of karma fortunes by now.munkymack ought to be getting tired of karma fortunes by now.munkymack ought to be getting tired of karma fortunes by now.munkymack ought to be getting tired of karma fortunes by now.munkymack ought to be getting tired of karma fortunes by now.munkymack ought to be getting tired of karma fortunes by now.munkymack ought to be getting tired of karma fortunes by now.munkymack ought to be getting tired of karma fortunes by now.
 
Posts: 2
Karma: 480384
Join Date: Feb 2013
Device: Android FB Reader
Wink Esquire.com Blogs Print Article links

First off: I'm brand new at this. This is only the second recipe I've tried to write

I'm trying to set up a recipe for Esquire.com blogs, since just the basic doesn't seem to work properly. But I'm running into a problem with swapping out URLs for the print version:

Regular version (via RSS):
http://www.esquire.com/blogs/culture...er-at-olympics

Print version:
http://www.esquire.com//print-this/w...mpics?page=all

I know how to sub in '?page=all', but I'm not sure how to swap out 'blogs/culture' for '/print-this'. Also, if I'm looking at the politics blog, it would be 'blogs/politics' (and other changes for different sections)

So two questions:

1. How do I swap out stuff in the middle of the URL?
2. Do I need to write a rule for each feed? Or is there some other way around that?
munkymack is offline   Reply With Quote
Old 02-12-2013, 11:24 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: 43,842
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
re.sub(r'esquire.com/[a-z]+/[a-z]+', 'esquire.com/print-this', url)
kovidgoyal is online now   Reply With Quote
Advert
Reply

Tags
esquire, newbie, print on demand


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The Economist: "See article" links point to web ugumba Recipes 4 06-26-2012 12:35 AM
How get full article when good looking page do not have print version and same url? newnick Recipes 2 07-08-2011 03:58 AM
Downloading and Converting Print version of RSS article Daanish87 Calibre 1 06-11-2010 02:08 AM
Any way to download & print Kindle article? jdouglasj Introduce Yourself 5 12-11-2009 10:09 AM
Sell Shipping the new Esquire cover Nate the great Flea Market 0 09-10-2008 02:11 PM


All times are GMT -4. The time now is 02:42 AM.


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