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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 03-14-2011, 11:14 AM   #1
eremiya
Junior Member
eremiya began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Mar 2011
Device: Kindle
Question getting the print version

How to get print version if link to page view as:
http://domain.tld/category/subcategory/[number]-[title]
and print version:
http://domain.tld/category/subcategory/[number]/print

Actually I need to replace the "hyphen" and everything that comes after it to "/print"
eremiya is offline   Reply With Quote
Old 03-17-2011, 11:42 AM   #2
Bobus
Junior Member
Bobus began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jan 2011
Device: Kindle
I think:

Code:
import re

def print_version(self, url):
    return re.sub(r'([0-9]*)\-.*', r'\g<1>/print', url)
if it's not work, send the right url.
Bobus is offline   Reply With Quote
Advert
Old 03-17-2011, 12:13 PM   #3
eremiya
Junior Member
eremiya began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Mar 2011
Device: Kindle
Uunfortunately did not work.

XML: http://k.img.com.ua/rss/ru/kyiv.xml
Example page: http://korrespondent.net/kyiv/119700...ka-v-etom-godu
Example print page: http://korrespondent.net/kyiv/1197007/print
eremiya is offline   Reply With Quote
Old 03-18-2011, 06:48 AM   #4
Bobus
Junior Member
Bobus began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Jan 2011
Device: Kindle
Code:
    def print_version(self, url):
        return url+'/print'
Because in the feed only the number is given.
Bobus 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
getting the print version ccrriiss Recipes 0 02-27-2011 04:33 PM
Is it possible to pull the print version mufc Recipes 6 01-31-2011 01:59 PM
Updated Christian Bible Launches eBook Version Before Print Version tubemonkey News 21 12-30-2010 03:53 PM
If i have a print version... dhume01 General Discussions 3 10-06-2010 08:38 PM
Print Version Neels Calibre 5 10-12-2009 03:09 PM


All times are GMT -4. The time now is 05:19 AM.


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