![]() |
#1381 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
In case anyone is interested:
I've begun reading Tom's Hardware. The recipe says a username and password is needed, but AFAICT, it's not. The RSS feeds directly from the site don't seem to ask for a login, and entering a random username and password into the calibre recipe seems to work fine. |
![]() |
![]() |
#1382 |
Little Fuzzy Soldier
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 580
Karma: 5711
Join Date: Sep 2008
Location: Nowhere in particular.
Device: cybook gen3, htc hero, ipaq 214
|
Custom recipe for iLiteratura.cz, a czech website focusing on literature, book reviews, culture.
|
![]() |
![]() |
#1383 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
The wife asks me to request a recipe (code) for recipes (food) from Epicurious:
http://www.epicurious.com/services/rss She particularly wants the Healthy Recipes, New Recipes, Latest Features and Blogs (the first four feeds). Thanks! Edit: I am slowly making progress at doing this myself. I wouldn't have posted the request, except that it was beyond my skills. Of course, with sufficient effort, skills tend to improve. ![]() I hope no one has spent too much time on it, although I can't yet determine if I will succeed. Question: one page has this code: Code:
<div class='padTop14' id="recipeIntroText"> <span id="truncatedText">Cooking a large piece of salmon fillet couldn’t be easier and helps ensure that the fish stays flaky and moist. The crushed caraway seeds in the...</span> <span class="greenLnk"><a class="greenLnk" onclick="swapIntroText(event);">more</a> ›</span> <script> var recipeIntroText = "Cooking a large piece of salmon fillet couldn\u0092t be easier and helps ensure that the fish stays flaky and moist. The crushed caraway seeds in the glaze add a subtle twist to the classic honey and mustard combination, which really complements the full flavor of the salmon."; </script> </div> Thanks. Last edited by Starson17; 02-07-2010 at 01:06 PM. |
![]() |
![]() |
#1384 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
|
Quote:
|
|
![]() |
![]() |
#1385 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
|
![]() |
![]() |
#1386 |
Member
![]() Posts: 23
Karma: 12
Join Date: Jan 2010
Location: Edinburgh, UK
Device: SONY PRS600, Apple iPhone 3G
|
epicurious recipe (a start)
here is a start for your epicurious recipe. if you look at the adventuregamers recipe there is an example of how to resolve multiple pages, however if there is a print version it is more likely to make things easier!
i reccommend to have a look at the docs on the wiki to see some other useful examples: http://bugs.calibre-ebook.com/wiki/RecipeTips |
![]() |
![]() |
#1387 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
Edit: If I understand your recipe, you figured out how to build the link to printer friendly version of the food recipes. That solves the problem above by avoiding the problem in the html code of the non-printer friendly version. However, in the blog links, I couldn't find a printer friendly version, so I need to either fix the problem or handle the two feeds differently. .... I'm off to read more sample recipes. Last edited by Starson17; 02-08-2010 at 11:23 AM. |
|
![]() |
![]() |
#1388 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
I did go back and look at the output. I couldn't find any missing pages from multipage articles or anything else missing in the output created using a fake name and password. I don't know if they've changed their policy, or if I missed something I would have seen by creating a user/pass.
|
![]() |
![]() |
#1389 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
|
The multi page thing applies to the Articles, not news. On Tom's Hardware articles tend to have more than one page and on such pages you will see that the print link is disabled and leads you to the login form.
For example see: http://www.tomshardware.com/reviews/...-ssd,2550.html However they do not protect the print URL itself so the recipe will work even without correct login credentials. I will not change the recipe to honor the spirit of intended usage. |
![]() |
![]() |
#1390 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
|
Quote:
Try this in your recipe: Code:
import urllib .... def get_browser(self): br = BasicNewsRecipe.get_browser() br.open('http://szmobil.sueddeutsche.de/login.php') if self.username is not None and self.password is not None: data = urllib.urlencode({ 'username':self.username ,'password':self.password ,'submit':'Login' ,'id':'0' }) br.open('http://szmobil.sueddeutsche.de/login.php',data) return br |
|
![]() |
![]() |
#1391 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Jan 2010
Device: Sony PRS-505
|
kiklop74 - many, many thanks for your efforts, but (I nearly don't have the heart to say it) it still doesn't work. Same result: downloaded articles are login-page
![]() Greetings, Gero |
![]() |
![]() |
#1392 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
|
Quote:
|
|
![]() |
![]() |
#1393 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
|
![]() |
![]() |
#1394 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Feb 2010
Device: Android/ G1
|
I am trying to create a custom recipe for the Turkish newspaper site Radikal. Here is my code:
Code:
class AdvancedUserRecipe1265645305(BasicNewsRecipe): title = u'Radikal' language = 'tr' oldest_article = 5 max_articles_per_feed = 5 cover_url = 'http://www.radikal.com.tr/D/i/1/V2/radikal_logo.jpg' feeds = [(u'Yazarlar', u'http://www.radikal.com.tr/d/rss/RssYazarlar.xml')] def print_version(self, url): return url.replace('aType=RadikalYazarYazisi', 'aType=HaberYazdir') 1- Could not fetch link http://www.radikal.com.tr/Default.aspx?aType=HaberYazdir&Ar ticleID=979148 Traceback (most recent call last): File "site-packages\calibre\web\fetch\simple.py", line 442, in process_links File "site-packages\calibre\web\feeds\news.py", line 599, in _postprocess_html AttributeError: 'NoneType' object has no attribute 'insert' http://www.radikal.com.tr/Default.as...ticleID=979148 saved to c:\docume~1\engin\locals~1\temp\calibre_0.6.37_nba ozi_plumber\feed_0\article_ 3\Default.xhtml There is a created issue for this "AttributeError" (http://bugs.calibre-ebook.com/ticket/1270). However, my page does not have the DOCTYPE issue. I do however get validation errors if I try to validate the page. 2- print_version function does not work for all the URLs. For instance: - 7% Article download failed: u'\u0130\u015fsiz aileye ayda 300 lira' Failed to download article: ... http://www.radikal.com.tr/Default.aspx?aType=RadikalYazarYazisi&ArticleID=979171 I would expect "RadikalYazarYazisi" to be replaced with "HaberYazdir" here. 3- On some pages I get " Exception: Could not fetch article. Run with -vv to see the reason", even though I have the "-vv" option. How do I set the debug mode on? Last edited by jackietreehorn; 02-08-2010 at 05:47 PM. |
![]() |
![]() |
#1395 | |
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:
I can't help with 1 or 3 and I am not versed in all of the ways of getting the print page but I am relatively sure the below code will work. Code:
def print_version(self, url): return url.replace('http://www.radikal.com.tr/Default.aspx?aType=HaberYazdir', 'http://www.radikal.com.tr/Default.aspx?aType=RadikalYazarYazisi') |
|
![]() |
![]() |
|
![]() |
||||
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 |