![]() |
#1621 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
|
|
![]() |
![]() |
#1622 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
|
New recipe for Oil Price:
|
![]() |
![]() |
#1623 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
Code:
def print_version(self, url): parts = url.rsplit('?') print_url = parts[0] + '?Print=Yes' return print_url |
|
![]() |
![]() |
#1624 | |
Member
![]() Posts: 15
Karma: 10
Join Date: Mar 2010
Device: PW2, K3gb(x2), K3w, K4, k5(x3) PRS-505s, Stanza for ipod
|
Quote:
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 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. ![]() |
|
![]() |
![]() |
#1625 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
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 |
![]() |
![]() |
#1626 | |
Member
![]() Posts: 15
Karma: 10
Join Date: Mar 2010
Device: PW2, K3gb(x2), K3w, K4, k5(x3) PRS-505s, Stanza for ipod
|
Quote:
![]() If I set it to fetch just the news feed it works, soon as there's more than one feed it stops working. ![]() |
|
![]() |
![]() |
#1627 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
Quote:
|
||
![]() |
![]() |
#1628 |
Junior Member
![]() 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. |
![]() |
![]() |
#1629 |
Junior Member
![]() 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'), ] |
![]() |
![]() |
#1630 | ||
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,897
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
Quote:
Quote:
I then decided to add Code:
img {max-width:100%;} ![]() 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%;} 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. |
||
![]() |
![]() |
#1631 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
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!
|
![]() |
![]() |
#1632 |
Junior Member
![]() 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 |
![]() |
![]() |
#1633 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
|
New recipe for Tulsa World:
|
![]() |
![]() |
#1634 |
Zealot
![]() ![]() ![]() ![]() ![]() Posts: 135
Karma: 488
Join Date: Mar 2010
Location: Tulsa, OK, USA
Device: Kindle 2, Sony PRS 900
|
![]() |
![]() |
![]() |
#1635 |
Junior Member
![]() 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. |
![]() |
![]() |
|
![]() |
||||
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 |