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-21-2011, 02:46 PM   #1
slex
Addict
slex ought to be getting tired of karma fortunes by now.slex ought to be getting tired of karma fortunes by now.slex ought to be getting tired of karma fortunes by now.slex ought to be getting tired of karma fortunes by now.slex ought to be getting tired of karma fortunes by now.slex ought to be getting tired of karma fortunes by now.slex ought to be getting tired of karma fortunes by now.slex ought to be getting tired of karma fortunes by now.slex ought to be getting tired of karma fortunes by now.slex ought to be getting tired of karma fortunes by now.slex ought to be getting tired of karma fortunes by now.
 
Posts: 294
Karma: 1196776
Join Date: Nov 2008
Location: Bulgaria
Device: Kindle 4 NT, Onyx Boox M92
I can't get print version, though it should be easy

This is the full article:

http://www.investor.bg/news/article/112881/332.html

And this is the print version:

http://www.investor.bg/news/printer/112881/332.html

From the recipe guide it looks like I should copy the BBC example for the print version and I add to the recipe the following:

Code:
def print_version(self, url):
        return url.replace('http://www.investor.bg/news/article/', 'http://www.investor.bg/news/printer/')
But I still get the full version, not the print version.

Can anyone give an advice?
slex is offline   Reply With Quote
Old 02-22-2011, 02:20 PM   #2
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by slex View Post
This is the full article:

http://www.investor.bg/news/article/112881/332.html

And this is the print version:

http://www.investor.bg/news/printer/112881/332.html

From the recipe guide it looks like I should copy the BBC example for the print version and I add to the recipe the following:

Code:
def print_version(self, url):
        return url.replace('http://www.investor.bg/news/article/', 'http://www.investor.bg/news/printer/')
But I still get the full version, not the print version.

Can anyone give an advice?
I looked at this feed:
http://rss.investor.bg/c/33288/f/564906/index.rss
That feed does not give a url in the form of
http://www.investor.bg/news/article/112881/332.html like you are expecting.

It looks like this:
http://rss.investor.bg/c/33288/f/564...ml/story01.htm
In the future, you might want to post the full recipe. I had to guess about where your feed was, so if I guessed wrong, try this:
Code:
    def print_version(self, url):
        newurl = url.replace('http://www.investor.bg/news/article/', 'http://www.investor.bg/news/printer/')
        print 'The original url is: ', url
        print 'The new url is: ', newurl
        return newurl
Then look at the output to make sure your links are being created correctly.
Starson17 is offline   Reply With Quote
Advert
Old 02-22-2011, 05:13 PM   #3
slex
Addict
slex ought to be getting tired of karma fortunes by now.slex ought to be getting tired of karma fortunes by now.slex ought to be getting tired of karma fortunes by now.slex ought to be getting tired of karma fortunes by now.slex ought to be getting tired of karma fortunes by now.slex ought to be getting tired of karma fortunes by now.slex ought to be getting tired of karma fortunes by now.slex ought to be getting tired of karma fortunes by now.slex ought to be getting tired of karma fortunes by now.slex ought to be getting tired of karma fortunes by now.slex ought to be getting tired of karma fortunes by now.
 
Posts: 294
Karma: 1196776
Join Date: Nov 2008
Location: Bulgaria
Device: Kindle 4 NT, Onyx Boox M92
Hello Starson17,

it looks like the url in the feed is really different from the one after the article is opened.

While probably it is possible to convert the feed url to the print url, as the article identifying elements are present in both, e.g. here:
Code:
http://rss.investor.bg/c/33288/f/564906/s/12e54176/l/0L0Sinvestor0Bbg0Cnews0Carticle0C1129450C3370Bhtml/story01.htm

http://www.investor.bg/news/printer/112945/337.html
I don't think that I can do the slicing and reshufling of the urls at this point. I find it easier to edit the content of the full articles and more or less get only the content I want.

Anyway, thanks for the help!

Last edited by slex; 02-22-2011 at 05:16 PM.
slex is offline   Reply With Quote
Old 02-23-2011, 08:54 AM   #4
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by slex View Post
I don't think that I can do the slicing and reshufling of the urls at this point. I find it easier to edit the content of the full articles and more or less get only the content I want.
I don't use the print version option much, either. Often it's missing larger photos or something else, and I find it just as easy to extract the article content from the full article page. Whatever works - there's lots of options.
Starson17 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
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
Need Help Splitting a Print URL ... easy stuff. HELP! mjcassel Recipes 2 11-25-2010 09:30 AM
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 01:02 AM.


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