Register Guidelines E-Books Today's Posts Search

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

Notices

Closed Thread
 
Thread Tools Search this Thread
Old 03-17-2010, 12:18 PM   #1621
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 ziegl027 View Post
Sadly, the daily strips are still truncated on the right, in both portrait and landscape. Do you (or anyone else) know if there is anything I can tweak in the recipe that will get them to display properly on my Touch?
Read this thread: https://www.mobileread.com/forums/showthread.php?t=77452
Starson17 is offline  
Old 03-17-2010, 02:31 PM   #1622
kiklop74
Guru
kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.
 
kiklop74's Avatar
 
Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
New recipe for Oil Price:
Attached Files
File Type: zip oilprice.zip (762 Bytes, 233 views)
kiklop74 is offline  
Advert
Old 03-17-2010, 05:07 PM   #1623
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 Starson17 View Post
I'll look for some when I get home. Just think of "url" as a string that you use Python string manipulation functions to modify before it gets returned.
Here's a simple way to do it:
Code:
    def print_version(self, url):
        parts = url.rsplit('?')
        print_url = parts[0] + '?Print=Yes'
        return print_url
It splits at the '?' and adds your '?Print=Yes' to the first half.
Starson17 is offline  
Old 03-18-2010, 03:49 AM   #1624
Ekips
Member
Ekips began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Mar 2010
Device: PW2, K3gb(x2), K3w, K4, k5(x3) PRS-505s, Stanza for ipod
Quote:
Originally Posted by Starson17 View Post
Here's a simple way to do it:
Code:
    def print_version(self, url):
        parts = url.rsplit('?')
        print_url = parts[0] + '?Print=Yes'
        return print_url
It splits at the '?' and adds your '?Print=Yes' to the first half.
Hi,

thanks for that but unfortunately it didn't work, not sure whats going on, I've tried copying some of the links into firefox and changing the ends to
Code:
?Print=Yes
in case it was different for some links and they all accept the print code.

This is pretty odd, A single url.replace will work for any of them, add another and they both stop.

Doesn't matter if they are stacked or two separate lines of code as soon as you add the second it cancels out the first.

I'm at your mercy guys, I don't have a clue now.
Ekips is offline  
Old 03-18-2010, 07:39 AM   #1625
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 Ekips View Post
Hi,

thanks for that but unfortunately it didn't work
It worked for me (to make the change you wanted - I didn't check the retrieved data). Are you using the CLI or a batch file with a line like this:

Code:
ebook-convert TheSun.recipe TheSun --test -vv> TheSun.txt
If so, what does the output file say is happening when it fetches?
Starson17 is offline  
Advert
Old 03-18-2010, 05:19 PM   #1626
Ekips
Member
Ekips began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Mar 2010
Device: PW2, K3gb(x2), K3w, K4, k5(x3) PRS-505s, Stanza for ipod
Quote:
Originally Posted by Starson17 View Post
It worked for me (to make the change you wanted - I didn't check the retrieved data). Are you using the CLI or a batch file with a line like this:

Code:
ebook-convert TheSun.recipe TheSun --test -vv> TheSun.txt
If so, what does the output file say is happening when it fetches?
Hi, I'm just running it in Calibre I didnt quite get the batch file or command line to work and figured I was being enough of a thread hog as it was.

If I set it to fetch just the news feed it works, soon as there's more than one feed it stops working.
Ekips is offline  
Old 03-18-2010, 05:47 PM   #1627
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 Ekips View Post
Hi, I'm just running it in Calibre I didnt quite get the batch file or command line to work and figured I was being enough of a thread hog as it was.
You can always open a new thread. You need to be able to see error messages, and add print statements to see what's happening. I find te batch file method works best for me.

Quote:
If I set it to fetch just the news feed it works, soon as there's more than one feed it stops working.
I didn't test all your feeds, just the last one you pointed me to, which was the news feed. Are you sure that putting 'Print=Yes' as a replacement for everything after '?' is the right thing to do?
Starson17 is offline  
Old 03-18-2010, 08:34 PM   #1628
ultimatebuster
Junior Member
ultimatebuster began at the beginning.
 
ultimatebuster's Avatar
 
Posts: 7
Karma: 10
Join Date: Jul 2009
Device: Kindle 2
I have a quick question about a custom recipe, why does the kindle cut the article off at one exactly one page (sometimes it displays only half of the line.) If I try to reduce the text size, it will show more.

I used print_version, not sure if that's the issue.

Last edited by ultimatebuster; 03-18-2010 at 10:25 PM.
ultimatebuster is offline  
Old 03-18-2010, 09:10 PM   #1629
adrnalin
Junior Member
adrnalin began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2010
Device: Sony PRS-600
Daily Telegraph Custom Recipe

Hi all,

This is my first post and i'd like to contribute my recipe for Australia Daily Telegraph. It's a cleaner than the original version, hopefully you guys enjoy it

Code:
#!/usr/bin/env  python
__license__   = 'GPL v3'
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
__docformat__ = 'restructuredtext en'

'''
http://www.news.com.au/dailytelegraph/
'''
import re
from calibre.web.feeds.news import BasicNewsRecipe

class DailyTelegraph(BasicNewsRecipe):
    title          = u'Daily Telegraph'
    __author__     = u'Adrian G.'
    language = 'en_AU'

    description    = u'Daily Telegraph News'
    oldest_article = 5
    max_articles_per_feed = 100
    no_stylesheets = True
    use_embedded_content = False
    no_javascript = True


    timefmt               = ' [%A, %d %B, %Y]'
    encoding = 'utf-8'

    keep_only_tags = [dict(name='div', attrs ={'id':'story'})]

    extra_css = '''
                  h1{font-family:Georgia,"Times New Roman",Times,serif; font-weight:bold; font-size:large;}
                  .cT-storyDetails{font-family:Arial,Helvetica,sans-serif; color:#666666;font-size:x-small;}
                  .articleBody{font-family:Arial,Helvetica,sans-serif; color:black;font-size:small;}
                  .cT-imageLandscape{font-family:Arial,Helvetica,sans-serif; color:#333333 ;font-size:x-small;}
                  .source{font-family:Arial,Helvetica,sans-serif; color:#333333 ;font-size:xx-small;}
                  #content{font-family:Arial,Helvetica,sans-serif;font-size:x-small;}
                  .pageprint{font-family:Arial,Helvetica,sans-serif;font-size:small;}
                  #bylineDetails{font-family:Arial,Helvetica,sans-serif; color:#666666;font-size:x-small;}
                  .featurePic-wide{font-family:Arial,Helvetica,sans-serif;font-size:x-small;}
                  #idfeaturepic{font-family:Arial,Helvetica,sans-serif;font-size:x-small;}
                  h3{font-family:Georgia,"Times New Roman",Times,serif; font-size:small;}
                  h2{font-family:Georgia,"Times New Roman",Times,serif; font-size:small;}
                  h4{font-family:Georgia,"Times New Roman",Times,serif; font-size:small;}
                  h5{font-family:Georgia,"Times New Roman",Times,serif; font-size:small;}
                  body{font-family:Arial,Helvetica,sans-serif; font-size:x-small;}
                '''

    remove_tags     = [
                        dict(name='div', attrs ={'id':['comments','story-related-coverage']}),
                        dict(name='div', attrs ={'class':['story-header-tools','story-footer','story-extras','story-related']}),
                        dict(name='div', attrs ={'class':['promo-image','story-extras story-extras-2']}),
                        dict(name='div', attrs ={'class':['assistive sidebar-jump']})
                       ]

    feeds          = [
                      (u'Top Stories', u'http://feeds.news.com.au/public/rss/2.0/dtele_top_stories_253.xml'),
                      (u'National News', u'http://feeds.news.com.au/public/rss/2.0/dtele_national_news_202.xml'),
                      (u'World News', u'http://feeds.news.com.au/public/rss/2.0/dtele_world_news_204.xml'), 
                      (u'NSW and ACT', u'http://feeds.news.com.au/public/rss/2.0/dtele_nswact_225.xml'),
                      (u'Arts', u'http://feeds.news.com.au/public/rss/2.0/dtele_art_444.xml'), 
                      (u'Business News', u'http://feeds.news.com.au/public/rss/2.0/dtele_business_226.xml'), 
                      (u'Entertainment News', u'http://feeds.news.com.au/public/rss/2.0/dtele_entertainment_news_201.xml'), 
                      (u'Lifestyle News', u'http://feeds.news.com.au/public/rss/2.0/dtele_lifestyle_227.xml'), 
                      (u'Music', u'http://feeds.news.com.au/public/rss/2.0/dtele_music_441.xml'), 
                      (u'Property Confidential', u'http://feeds.news.com.au/public/rss/2.0/dtele_property_confidential_463.xml'), 
                      (u'Property - Your Space', u'http://feeds.news.com.au/public/rss/2.0/dtele_property_yourspace_462.xml'),
                      (u'Confidential News', u'http://feeds.news.com.au/public/rss/2.0/dtele_entertainment_confidential_252.xml'), 
                      (u'Confidential Biographies', u'http://feeds.news.com.au/public/rss/2.0/dtele_confidential_biographies_491.xml'), 
                      (u'Confidential Galleries', u'http://feeds.news.com.au/public/rss/2.0/dtele_confidential_galleries_483.xml'),
                      ]
adrnalin is offline  
Old 03-18-2010, 11:15 PM   #1630
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,897
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
Quote:
Originally Posted by ziegl027 View Post
I remain eternally grateful, and don't know if the issue is something with me/my device, or that today was Sundays, but the comics are clipped off on the right hand side . Tried changing the orientation and they are bigger, and still clipped off. Will try again tomorrow to see if the dailies fare better!
Quote:
Originally Posted by Starson17 View Post
One of the readers is very easy to use, and my wife would like to be able to read the comics with that reader, but it's the one that cuts off the right. Can you, or anyone else, guide me towards how I might customize the recipe to help avoid cutting off the comics on the right. Was a CSS change made to help with this problem on the SONY? I know extra CSS can be added to a recipe.
To fix this first I changed my output profile to the Sony 300. This did help, a sliver was still chopped off but it was readable.

I then decided to add
Code:
img {max-width:100%;}
to the css I use for my PRS-505 and it works! It keeps the comics from exceeding the screen width.

You ought to be able to add this code to the extra css area under preferences - conversion - look & feel - extra css and prevent any images from exceeding the width of the screen.

So changing the profile to Sony 300 helped a little but adding the code to the css was a complete solution for any output profile selected.

Update: I created a css just for my comics by adding in
Code:
img {max-width:100%; min-width:100%;}
this way the single pane comics end up full screen. I might drop the minimum width a bit as I refine it, but I do like the single pane comics being large.

The minimum width setting would screw up many books so for the most part it is limited to comics.

Last edited by DoctorOhh; 03-18-2010 at 11:57 PM.
DoctorOhh is offline  
Old 03-19-2010, 07:59 AM   #1631
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 dwanthny View Post
You ought to be able to add this code to the extra css area
Great. Adding code like this was what I had in mind when I asked about possible CSS code to fix the image cutoff problems being reported. I'm not very good with the CSS options and don't have anything that Calibre recognizes as an "ereader" so I'm going to try your code directly in the recipe code. Thanks for the post/information!
Starson17 is offline  
Old 03-19-2010, 09:13 AM   #1632
Semonski
Junior Member
Semonski began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Mar 2010
Device: Kindle DX
Hi.... First off.... I would appreciate some help with a recipe for the New York Post....

http://nypost.com/rss

I've toyed with this, and just can't seem to get it.... Although I AM NOT a python programmer.... any help would be greatly appreciated



And, below is a modification of some other recipe that I did for the Washington Times..... I'm a bit of a hack, so not sure if this is perfect, but the MOBI version seems to work very well with my Kindle....

******* start recipe
#!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
__docformat__ = 'restructuredtext en'

import re
from calibre.web.feeds.news import BasicNewsRecipe


class WashingtonTimes(BasicNewsRecipe):

title = 'Washington Times'
max_articles_per_feed = 15
html2lrf_options = ['--override-css= "H1 {font-family: Arial; font-weight: bold; color: #000000; size: 10pt;}"']
language = 'en'


preprocess_regexps = [ (re.compile(i[0], re.IGNORECASE | re.DOTALL), i[1]) for i in
[
(r'<HEAD>.*?</HEAD>' , lambda match : '<HEAD></HEAD>'),
(r'<div id="apple-rss-sidebar-background">.*?<!-- start Entries -->', lambda match : ''),
(r'<!-- end apple-rss-content-area -->.*?</body>', lambda match : '</body>'),
(r'<script.*?>.*?</script>', lambda match : ''),
(r'<body onload=.*?>.*?<a href="http://www.upi.com">', lambda match : '<body style="font: 8pt arial;">'),
##(r'<div class=\'headerDIV\'><h2><a style="color: #990000;" href="http://www.washingtontimes.com/NewsTrack/Top_News/">Top News</a></h2></div>.*?<br clear="all">', lambda match : ''),
(r'<script src="http://www.g.*?>.*?</body>', lambda match : ''),
(r'<span style="font: 16pt arial', lambda match : '<span style="font: 12pt arial'),
]
]



def get_feeds(self):
return [ (u'Headlines', u'http://www.washingtontimes.com/rss/headlines/news/headlines/'),
(u'Newsmakers', u'http://www.washingtontimes.com/rss/headlines/news/newsmakers/'),
(u'National', u'http://www.washingtontimes.com/rss/headlines/news/national/'),
(u'World', u'http://www.washingtontimes.com/rss/headlines/news/world/'),
(u'Editor Favs', u'http://www.washingtontimes.com/rss/headlines/news/editor-favorites/'),
(u'Editorials', u'http://www.washingtontimes.com/rss/headlines/opinion/editorials/'),
(u'Cartoons', u'http://www.washingtontimes.com/rss/headlines/opinion/cartoons/'),
(u'Business', u'http://www.washingtontimes.com/rss/headlines/news/business/'),
(u'Technology', u'http://www.washingtontimes.com/rss/headlines/news/technology/'),
(u'Security', u'http://www.washingtontimes.com/rss/headlines/news/security/'),
(u'Politics', u'http://www.washingtontimes.com/rss/headlines/news/politics/'),
(u'Congress', u'http://www.washingtontimes.com/rss/headlines/news/congress/'),
]

def print_version(self, url):
return url + '/print/'

******* end recipe
Semonski is offline  
Old 03-19-2010, 04:50 PM   #1633
kiklop74
Guru
kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.
 
kiklop74's Avatar
 
Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
New recipe for Tulsa World:
Attached Files
File Type: zip tulsaworld.zip (4.4 KB, 208 views)
kiklop74 is offline  
Old 03-19-2010, 04:56 PM   #1634
tulsa
Zealot
tulsa has a complete set of Star Wars action figures.tulsa has a complete set of Star Wars action figures.tulsa has a complete set of Star Wars action figures.tulsa has a complete set of Star Wars action figures.tulsa has a complete set of Star Wars action figures.
 
tulsa's Avatar
 
Posts: 135
Karma: 488
Join Date: Mar 2010
Location: Tulsa, OK, USA
Device: Kindle 2, Sony PRS 900
Thumbs up

Quote:
Originally Posted by kiklop74 View Post
New recipe for Tulsa World:
woo hoo! thanks!
tulsa is offline  
Old 03-21-2010, 05:37 PM   #1635
nextONE
Junior Member
nextONE is on a distinguished road
 
Posts: 6
Karma: 54
Join Date: Mar 2010
Device: Kindle
Request for Recipe

Can anyone help me to get a recipe for congressdaily from the National Journal? I am looking to get the RSS feed and ability to login.

http://www.nationaljournal.com/rss/congressdailyam.rss

Thanks for your help.
nextONE is offline  
Closed Thread


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom column read ? pchrist7 Calibre 2 10-04-2010 02:52 AM
Archive for custom screensavers sleeplessdave Amazon Kindle 1 07-07-2010 12:33 PM
How to back up preferences and custom recipes? greenapple Calibre 3 03-29-2010 05:08 AM
Donations for Custom Recipes ddavtian Calibre 5 01-23-2010 04:54 PM
Help understanding custom recipes andersent Calibre 0 12-17-2009 02:37 PM


All times are GMT -4. The time now is 03:47 AM.


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