![]() |
#1606 | ||
Member
![]() Posts: 15
Karma: 10
Join Date: Mar 2010
Device: PW2, K3gb(x2), K3w, K4, k5(x3) PRS-505s, Stanza for ipod
|
Quote:
There's a few that come back with the Quote:
that one for example. I think its Code:
<div id="vxFlashPlayer"><div id="vxFlashPlayerContent" style="width: 380px; height: 278px;"> And a few are coming back as blank, and the £ is coming up as Ł. so I still have some tweaking to do, but I'm finding it interesting (and very distracting) How do you run the recipe in test mode? I've been running the thing in calibre and downloading the full feeds, takes ages each time ![]() |
||
![]() |
![]() |
#1607 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
See here and here. It's much faster. I'll try to look at your problem pages tomorrow (if you haven't already solved the problems). |
|
![]() |
Advert | |
|
![]() |
#1608 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
Code:
dict(name='div', attrs={'id':'vxFlashPlayer'}) |
|
![]() |
![]() |
#1609 |
Nameless Being
|
Revised SFBG recipe
I had requested a recipe for the San Francisco Bay Guardian, and this was included in the latest version release of Calibre. Unfortunately the stock recipe results in the download of only a small part of the total weekly paper. I understand why as at the main RSS page for the SFBG web site the link labeled “Main Site (everything) “ is not that at all [everything]. Using the stock recipe as I guide I have prepared the expanded version here that obtains not everything, but at least a lot more. That is if anyone else is interested.
Spoiler:
|
![]() |
#1610 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Mar 2010
Device: Sony pocket edition
|
321gold custom recipe request
would love a custom recipe to create an ebook of all the articles listed on this page:
http://www.321gold.com/archives/archive.php Thanks! |
![]() |
Advert | |
|
![]() |
#1611 | |
Member
![]() Posts: 15
Karma: 10
Join Date: Mar 2010
Device: PW2, K3gb(x2), K3w, K4, k5(x3) PRS-505s, Stanza for ipod
|
Quote:
Code:
encoding= 'iso-8859-1' Does the order you put the keep tags affect the order they show up? Spoiler:
that's the updated recipe. I've been playing with firebug and also installed Python 2.6 and been learning a little of that ![]() |
|
![]() |
![]() |
#1612 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
|
![]() |
![]() |
#1613 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
|
Quote:
Actually it does have an effect. If for example you have content like this: PHP Code:
Code:
keep_only_tags=[dict(name='div',attrs={'class':['c','a','b']})] Code:
<div class="c"></div> <div class="a"></div> <div class="b"></div> |
|
![]() |
![]() |
#1614 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
To get the order-dependent result above, it looks like Calibre's recipe code scans the entire page against the first item in the list (c), then scans the entire page again against the second item (a) and finally scans the entire page a third time against the last item in the list (b). |
|
![]() |
![]() |
#1615 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
|
That is how it works. And it is actually a good feature as it enables you to easily reorder pieces of page in case where it is necessary.
|
![]() |
![]() |
#1616 |
Nameless Being
|
East Bay Express
|
![]() |
#1617 | |
Member
![]() Posts: 15
Karma: 10
Join Date: Mar 2010
Device: PW2, K3gb(x2), K3w, K4, k5(x3) PRS-505s, Stanza for ipod
|
Quote:
Been tweaking and playing and trying to figure out why I'm still pulling up all the slide show tags in the print version. I checked the Job Details and noticed the url.replace was not working. This is my cleaned up (thanks to Starson17) url.replace code Code:
def print_version(self, url): url.replace('?OTC-RSS&ATTR=News' , '?print=yes'), url.replace('?OTC-RSS&ATTR=Royals', '?print=yes'), url.replace('?OTC-RSS&ATTR=Our+Boys', '?print=yes'), url.replace('?OTC-RSS&ATTR=Gizmo', '?print=yes'), url.replace('?OTC-RSS&ATTR=Boxing', '?print=yes'), url.replace('?OTC-RSS&ATTR=Cricket', '?print=yes'), url.replace('?OTC-RSS&ATTR=Football', '?print=yes'), url.replace('?OTC-RSS&ATTR=Rugby+Union', '?print=yes'), url.replace('?OTC-RSS&ATTR=Tv', '?print=yes'), url.replace('?OTC-RSS&ATTR=Bizarre', '?print=yes'), url.replace('?OTC-RSS&ATTR=Usa', '?print=yes'), url.replace('?OTC-RSS&ATTR=Film', '?print=yes'), url.replace('?OTC-RSS&ATTR=HomePage', '?print=yes') return url Code:
Downloading Fetching http://www.thesun.co.uk/sol/homepage/news/campaigns/our_boys/2895923/Soldiers-killed-in-Afghan-blast.html?OTC-RSS&ATTR=Our+Boys Downloading Fetching http://www.thesun.co.uk/sol/homepage/news/2895648/Grieving-dads-drug-warning.html?OTC-RSS&ATTR=News Downloading Fetching http://www.thesun.co.uk/sol/homepage/news/2895808/Soup-poison-bid-at-posh-school.html?OTC-RSS&ATTR=News Downloading Fetching http://www.thesun.co.uk/sol/homepage/news/campaigns/our_boys/2895647/Royal-Navy-sends-Swiftsure-class-attack-submarine-to-Falkland-Islands-to-boost-security.html?OTC-RSS&ATTR=Our+Boys Code:
def print_version(self, url): return url.replace('OTC-RSS&ATTR=News', 'print=yes') # def print_version(self, url): # url.replace('?OTC-RSS&ATTR=News' , '?print=yes') # url.replace('?OTC-RSS&ATTR=Royals', '?print=yes') # url.replace('?OTC-RSS&ATTR=Gizmo', '?print=yes') # url.replace('?OTC-RSS&ATTR=Boxing', '?print=yes') # url.replace('?OTC-RSS&ATTR=Cricket', '?print=yes') # url.replace('?OTC-RSS&ATTR=Football', '?print=yes') # url.replace('?OTC-RSS&ATTR=Rugby+Union', '?print=yes') # url.replace('?OTC-RSS&ATTR=Tv', '?print=yes') # url.replace('?OTC-RSS&ATTR=Bizarre', '?print=yes') # url.replace('?OTC-RSS&ATTR=Usa', '?print=yes') # url.replace('?OTC-RSS&ATTR=Film', '?print=yes') # url.replace('?OTC-RSS&ATTR=HomePage', '?print=yes') # return url Code:
Downloading Fetching http://www.thesun.co.uk/sol/homepage/news/campaigns/our_boys/2895923/Soldiers-killed-in-Afghan-blast.html?OTC-RSS&ATTR=Our+Boys Downloading Fetching http://www.thesun.co.uk/sol/homepage/news/2895648/Grieving-dads-drug-warning.html?print=yes Downloading Fetching http://www.thesun.co.uk/sol/homepage/news/2895808/Soup-poison-bid-at-posh-school.html?print=yes Downloading Fetching http://www.thesun.co.uk/sol/homepage/news/campaigns/our_boys/2895647/Royal-Navy-sends-Swiftsure-class-attack-submarine-to-Falkland-Islands-to-boost-security.html?OTC-RSS&ATTR=Our+Boys Code:
def print_version(self, url): url.replace('OTC-RSS&ATTR=News' , 'print=yes'), url.replace('?OTC-RSS&ATTR=Royals', '?print=yes'), url.replace('?OTC-RSS&ATTR=Our+Boys', '?print=yes'), url.replace('?OTC-RSS&ATTR=Gizmo', '?print=yes'), url.replace('?OTC-RSS&ATTR=Boxing', '?print=yes'), url.replace('?OTC-RSS&ATTR=Cricket', '?print=yes'), url.replace('?OTC-RSS&ATTR=Football', '?print=yes'), url.replace('?OTC-RSS&ATTR=Rugby+Union', '?print=yes'), url.replace('?OTC-RSS&ATTR=Tv', '?print=yes'), url.replace('?OTC-RSS&ATTR=Bizarre', '?print=yes'), url.replace('?OTC-RSS&ATTR=Usa', '?print=yes'), url.replace('?OTC-RSS&ATTR=Film', '?print=yes'), url.replace('?OTC-RSS&ATTR=HomePage', '?print=yes') return url Code:
Downloading Fetching http://www.thesun.co.uk/sol/homepage/news/campaigns/our_boys/2895923/Soldiers-killed-in-Afghan-blast.html?OTC-RSS&ATTR=Our+Boys Downloading Fetching http://www.thesun.co.uk/sol/homepage/news/2895648/Grieving-dads-drug-warning.html?OTC-RSS&ATTR=News Downloading Fetching http://www.thesun.co.uk/sol/homepage/news/2895808/Soup-poison-bid-at-posh-school.html?OTC-RSS&ATTR=News Downloading Fetching http://www.thesun.co.uk/sol/homepage/news/campaigns/our_boys/2895647/Royal-Navy-sends-Swiftsure-class-attack-submarine-to-Falkland-Islands-to-boost-security.html?OTC-RSS&ATTR=Our+Boys Is their a way to replace everything after Code:
.html? Code:
?Print=Yes |
|
![]() |
![]() |
#1618 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
|
![]() |
![]() |
#1619 |
Zealot
![]() ![]() ![]() ![]() ![]() Posts: 135
Karma: 488
Join Date: Mar 2010
Location: Tulsa, OK, USA
Device: Kindle 2, Sony PRS 900
|
![]()
Hello all, I've been trying to get a custom recipe for the following feed:
http://www.tulsaworld.com/site/rss/rss.aspx?group=1 As an example, one of the stories links to here: Code:
http://www.tulsaworld.com/news/article.aspx?subjectid=337&articleid=20100317_13_A6_PopeBe928321&rss_lnk=1 Code:
http://www.tulsaworld.com/site/printerfriendlystory.aspx?articleid=20100317_13_A6_PopeBe928321 Can anybody help me out? thanks! |
![]() |
![]() |
#1620 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
I don't think you actually want to do that, though. Look carefully at what you wrote, since doing exactly what you propose would put in two "??". ![]() Aside from that, yes, it's possible..... I'm not at home, so I can't write it for you, but there are lots of sample recipes to look at. One way would be to simply use a compiled regular expression to modify url. You'd need "import re" in the imports and you'd: Code:
def print_version(self, url): search and replace in the url string ".html?.*first_char_after_string_to_be_replaced" with ".html?Print=Yesfirst_char_after_string_to_be_replaced" return url If you have a decent search tool, just look at some built-in recipes that have "import re" in them for the syntax you need. Or look at string tools for Python. I've got lots of samples at home, and I just cut and paste them, so I can't remember the syntax. If you're still having trouble, I'm sure kiklop can give you code, or 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. |
|
![]() |
![]() |
|
![]() |
||||
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 |