|
|
#1 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,698
Karma: 16542228
Join Date: Feb 2010
Location: Pennsylvania
Device: Huawei MediaPad M5, LG V30, Boyue T80S, Nexus 7 LTE, K3 3G, Fire HD8
|
Philadelphia Inquirer recipe not working correctly
I was looking at the epub from the Philadelphia Inquirer recipe and noticed a problem. A lot of the articles are on more than one page - like where the article has "Page: 1 of 3 View All" at the bottom. If "?viewAll=y" is added to the end of the link it will have all pages on one screen but I cannot figure out how to do that. Even if an article has only one page, adding "?viewAll=y" to the end does not cause any problem.
I was looking to use preprocess_html to add it, but discovered that only has the title and text of the article. Where can I do this, and is there an example somewhere or an area of the documentation I can look at? Here's a link showing only the first page of the article and one showing all pages. First page only - http://www.philly.com/philly/news/20...00-watter.html All pages - http://www.philly.com/philly/news/20...html?viewAll=y Here's the rss it's in http://www.philly.com/inquirer_front_page.rss Last edited by Purple Lady; 01-01-2012 at 06:13 PM. Reason: added rss link |
|
|
|
|
|
#2 |
|
onlinenewsreader.net
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 331
Karma: 10143
Join Date: Dec 2009
Location: Phoenix, AZ & Victoria, BC
Device: Kindle 3, Kindle Fire, IPad3, iPhone4, Playbook, HTC Inspire
|
Define print_version in your recipe to add the viewAll part of the URL. See the documentation in http://manual.calibre-ebook.com/news...asicNewsRecipe
|
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,698
Karma: 16542228
Join Date: Feb 2010
Location: Pennsylvania
Device: Huawei MediaPad M5, LG V30, Boyue T80S, Nexus 7 LTE, K3 3G, Fire HD8
|
So all I need to add is this? It's not working and I added the print statement to see if it's even getting here and it's not.
Code:
def print_version(self, url):
print ' @@@ url: ',url
return url + '?viewAll=y'
The recipe is pretty simple Code:
class AdvancedUserRecipe1325116587(BasicNewsRecipe):
title = u'Philadelphia Inquirer new2'
oldest_article = 1
max_articles_per_feed = 50
auto_cleanup = True
no_stylesheets = True
remove_empty_feeds = True
feeds = [(u'Front Page' , u'http://www.philly.com/inquirer_front_page.rss'),
(u'Philly.com National/World' , u'http://www.philly.com/philly_news_nation.rss'),
(u'Philly.com Politics ' , u'http://www.philly.com/philly_politics.rss'),
(u'Business' , u'http://www.philly.com/inq_business.rss'),
(u'Personal Finance' , u'http://www.philly.com/philly_business_personal_finance.rss'),
(u'News Columnists' , u'http://www.philly.com/inq_columnists.rss'),
(u'Annette John-Hall' , u'http://www.philly.com/philly/columnists/annette_john-hall/index.rss2'),
(u'Dick Polman' , u'http://www.philly.com/philly/columnists/dick_polman/index.rss2'),
(u'Editorial' , u'http://www.philly.com/inq_news_editorial.rss'),
(u'Philly.com News' , u'http://www.philly.com/philly_news.rss'),
(u'Philly.com Local' , u'http://www.philly.com/philly_news_local.rss'),
(u'South Jersey News' , u'http://www.philly.com/inq_news_south_jersey.rss'),
(u'Tech News' , u'http://www.philly.com/philly_tech.rss'),
(u'Weekend' , u'http://www.philly.com/inq_entertainment_weekend.rss'),
(u'Books' , u'http://www.philly.com/inq_books.rss'),
(u'Entertainment' , u'http://www.philly.com/inq_entertainment.rss'),
(u'Food' , u'http://www.philly.com/inq_food.rss'),
(u'Planet of the Apes' , u'http://www.philly.com/evolution.rss'),
(u'Health and Science' , u'http://www.philly.com/inquirer_health_science.rss'),
(u'Home and Design' , u'http://www.philly.com/inq_home_design.rss'),
(u'Daily Magazine' , u'http://www.philly.com/inq_magazine_daily.rss')]
def print_version(self, url):
print ' @@@ url: ',url
return url + '?viewAll=y'
|
|
|
|
|
|
#4 |
|
onlinenewsreader.net
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 331
Karma: 10143
Join Date: Dec 2009
Location: Phoenix, AZ & Victoria, BC
Device: Kindle 3, Kindle Fire, IPad3, iPhone4, Playbook, HTC Inspire
|
Python is very sensitive to indenting. Your definition of print_version is not inside the recipe definition which is probably why it's not being invoked. You have to indent it to the same level as your other recipe items.
|
|
|
|
|
|
#5 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,698
Karma: 16542228
Join Date: Feb 2010
Location: Pennsylvania
Device: Huawei MediaPad M5, LG V30, Boyue T80S, Nexus 7 LTE, K3 3G, Fire HD8
|
I just figured that out. I thought I would get an error for indenting like I have gotten a thousand times already.
Thanks! |
|
|
|
| Advert | |
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PRS-350 Search function not working correctly | skypilotpete | Sony Reader | 15 | 11-22-2011 10:05 PM |
| A better Philadelphia Inquirer Recipe | bing | Recipes | 4 | 09-08-2011 10:14 AM |
| Philadelphia Inquirer Recipe | lgwapnitsky | Recipes | 8 | 06-28-2011 10:51 PM |
| AJC Recipe not working correctly (will be fixed soon) | TonytheBookworm | Recipes | 0 | 12-24-2010 07:41 PM |
| Request: Inquirer.net Recipe update | zoilom | Recipes | 0 | 12-21-2010 01:06 AM |