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 06-19-2010, 07:41 AM   #2146
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 gambarini View Post
Because It is an obfuscated feed, ok...
otherwise the print link is under a findable tag.
Yes. It's not very obfuscated.
Starson17 is offline  
Old 06-19-2010, 07:47 AM   #2147
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 gambarini View Post
i have solved my problem with parse index and with multiple pages...
Congratulations!
Quote:
I "re"-post 3 recipes that i have posted but i don't find them in the new version of calibre.
Posting here makes it available to others faster. Posting in the bug tracker makes it more likely that Kovid will do something with the recipe - as it gets a number that he will definitely look at. When it's in the bug tracker, it's a strong sign that you consider it tested and ready for inclusion.

If it looks like you are still working on it, even after it is posted here, it probably won't be picked up. It's also easy to get lost here in all the posts, particularly if Kovid is busy on the code.
Starson17 is offline  
Advert
Old 06-19-2010, 08:04 AM   #2148
rty
Zealot
rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.
 
Posts: 108
Karma: 6066
Join Date: Apr 2010
Location: Singapore
Device: iPad Air, Kindle DXG, Kindle Paperwhite
Quote:
Originally Posted by Starson17 View Post
So you don't need comments on why multipage didn't work when you copied from AdventureGamer?
Yes, I still am interested in learning why the multipage didn't work.

Thanks.
rty is offline  
Old 06-19-2010, 08:06 AM   #2149
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 rty View Post
How do we remove width property in tables? This conversion_options doesn't seem to remove it.
1. Sounds like a bug to me - ask for it to be fixed.
2. Meanwhile use preprocess_html, soup.findAll and extract from the soup all tags having attribute width (assuming only tags you want removed have that property), or
3. Use preprocess_regexps. It's basically text-based, not tag-based, search and replace in the html.
Starson17 is offline  
Old 06-19-2010, 08:28 AM   #2150
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 rty View Post
Yes, I still am interested in learning why the multipage didn't work.

Thanks.
There are two major errors I see, before looking closely. First, there's no indent. (I'm sure you have it indented, so use the code tags to paste them in here. It's really hard to even read, much less test your recipe. If you really want to be nice to others, wrap code tags "#Button" around first, then wrap Spoiler "X on the Eye Button" around that.)

Second, I see append_page defined, but not used. You use it in preprocess_html.

Here is where it's used in AdventureGamers:

Spoiler:
Code:
    def preprocess_html(self, soup):
        mtag = '<meta http-equiv="Content-Language" content="en-US"/>\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>'
        soup.head.insert(0,mtag)    
        for item in soup.findAll(style=True):
            del item['style']
        self.append_page(soup, soup.body, 3)
        pager = soup.find('div',attrs={'class':'toolbar_fat'})
        if pager:
           pager.extract()        
        return soup
Starson17 is offline  
Advert
Old 06-19-2010, 08:52 AM   #2151
rty
Zealot
rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.
 
Posts: 108
Karma: 6066
Join Date: Apr 2010
Location: Singapore
Device: iPad Air, Kindle DXG, Kindle Paperwhite
Thanks Carson. I really appreciate your help. I have modified my original post to include code tag and spoiler button. Again thanks.


Spoiler:
Code:
 
class AdvancedUserRecipe1275708473(BasicNewsRecipe):
    title          = u'My Psychology Today'
    # oldest_article = 7
    max_articles_per_feed = 100
    remove_javascript = True
    use_embedded_content   = False
    no_stylesheets = True
    language = 'en'

    keep_only_tags = [dict(name='div', attrs={'id':['contentColumn','content-content']})]
    remove_tags = [
                    dict(name='div', attrs={'id':'advertisement advertisement-zone-51'}),
                    dict(name='div', attrs={'id':'block-td_search_160'}),
                    dict(name='div', attrs={'id':'block-cam_search_160'}),
                    dict(name='div', attrs={'class':'article-sub-meta'}),
   	dict(name='div', attrs={'class':'article-terms meta'}),
                         ] 
    # remove_tags_after  = dict(id=['rightColumn'])
    feeds          = [(u'Contents', u'http://www.psychologytoday.com/articles/index.rss')]

   
    def append_page(self, soup, appendtag, position):
        pager = soup.find('div',attrs={'class':'pager-next'})
        if pager:
           nexturl = self.INDEX + pager.a['href']
           soup2 = self.index_to_soup(nexturl)
           texttag = soup2.find('div', attrs={'id':'contentColumn'})
           for it in texttag.findAll(style=True):
               del it['style']
           newpos = len(texttag.contents)          
           self.append_page(soup2,texttag,newpos)
           texttag.extract()
           appendtag.insert(position,texttag)

    def postprocess_html(self, soup, first):
               for tag in soup.findAll(name=['ul', 'li']):
                    tag.name = 'div'
               return soup
rty is offline  
Old 06-19-2010, 08:56 AM   #2152
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 rty View Post
Thanks Carson. I really appreciate your help. I have modified my original post to include code tag and spoiler button. Again thanks.
It's Starson and you still haven't used append_page. Add preprocess_html the way that it's used in AG.
Starson17 is offline  
Old 06-19-2010, 08:58 AM   #2153
rty
Zealot
rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.
 
Posts: 108
Karma: 6066
Join Date: Apr 2010
Location: Singapore
Device: iPad Air, Kindle DXG, Kindle Paperwhite
Quote:
Originally Posted by bhandarisaurabh View Post
I would like to request a new recipe
for forbes india magazine
http://business.in.com/magazine/
thanks in advance
Here it is: the recipe for Forbes India.
Attached Files
File Type: zip Forbes India.zip (1,023 Bytes, 167 views)
rty is offline  
Old 06-19-2010, 09:01 AM   #2154
rty
Zealot
rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.
 
Posts: 108
Karma: 6066
Join Date: Apr 2010
Location: Singapore
Device: iPad Air, Kindle DXG, Kindle Paperwhite
Quote:
Originally Posted by Starson17 View Post
It's Starson and you still haven't used append_page. Add preprocess_html the way that it's used in AG.
Oops.... I am very sorry... please accept my apology, Starson.

Again thanks for the pointer. I'll study the Adventure Gamer code again.
rty is offline  
Old 06-19-2010, 09:47 AM   #2155
flyash
Groupie
flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.
 
Posts: 196
Karma: 1003498
Join Date: Jun 2010
Device: none
Quote:
Originally Posted by flyash View Post
The current Instapaper recipe fetches all the articles in one's Instapaper account. Depending on one's browsing/reading habits, this often results in an ebook with articles on a variety of unrelated topics.

Instapaper has folders functionality, that allows you to group your articles however you see fit, for example, by subject matter. Can the Instapaper recipe be modified to fetch articles by folder - that way you end up with an ebook for each group of articles? And then users can use their ereader's functionality to categorize those ebooks as they normally would (e.g., use the Collections functionality in Sony readers).
Any interest in this? Or is it not technically feasible?
flyash is offline  
Old 06-19-2010, 10:54 AM   #2156
rty
Zealot
rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.
 
Posts: 108
Karma: 6066
Join Date: Apr 2010
Location: Singapore
Device: iPad Air, Kindle DXG, Kindle Paperwhite
Quote:
Originally Posted by flyash View Post
Any interest in this? Or is it not technically feasible?
What are you talking about? Instapaper has been incorporated into Calibre built-in recipes since long time ago.
rty is offline  
Old 06-19-2010, 10:57 AM   #2157
rty
Zealot
rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.rty got an A in P-Chem.
 
Posts: 108
Karma: 6066
Join Date: Apr 2010
Location: Singapore
Device: iPad Air, Kindle DXG, Kindle Paperwhite
Attached is a recipe for Today Online - Another Singapore English Daily Newspaper
Attached Files
File Type: zip TodayOnline.zip (1.1 KB, 233 views)
rty is offline  
Old 06-19-2010, 11:09 AM   #2158
flyash
Groupie
flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.
 
Posts: 196
Karma: 1003498
Join Date: Jun 2010
Device: none
Quote:
Originally Posted by rty View Post
What are you talking about? Instapaper has been incorporated into Calibre built-in recipes since long time ago.
I'm not sure how I would explain it differently than in the post above, but I'll try. The current Instapaper recipe fetches all unarchived articles in your Instapaper account. But now that Instapaper has folders, I'm wondering if the recipe can be modified so that it fetches articles by folder, that way you create a different ebook for each Instapaper folder's articles (that way your articles are organized by subject, rather than having one big ebook with an assortment of articles on various subjects).

Currently, if you put all your Instapaper articles in folders, the Instapaper recipe fetches nothing, so apparently it can only see unfoldered articles.

And I'm not suggesting replacing the old Instapaper recipe (since some people with only a few articles might prefer not using Instapaper's folders and just having everything in one ebook), but adding a new recipe(s) that does a folder fetch.

Last edited by flyash; 06-19-2010 at 11:13 AM.
flyash is offline  
Old 06-19-2010, 11:50 AM   #2159
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 rty View Post
Oops.... I am very sorry... please accept my apology, Starson.

Again thanks for the pointer. I'll study the Adventure Gamer code again.
No problem
Let us know if you have trouble with the AG code.
Starson17 is offline  
Old 06-19-2010, 12:20 PM   #2160
flyash
Groupie
flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.flyash ought to be getting tired of karma fortunes by now.
 
Posts: 196
Karma: 1003498
Join Date: Jun 2010
Device: none
Quote:
Originally Posted by flyash View Post
Currently, if you put all your Instapaper articles in folders, the Instapaper recipe fetches nothing, so apparently it can only see unfoldered articles.
It seems that Instapaper defaults to putting saved articles in a 'Read Later' folder, and this is what Calibre's recipe is looking for, so if you make new folders to organize your articles and move all unarchived articles to the new folders, the recipe will only fetch from the empty 'Read Later' folder, and return an empty ebook.

So it would seem that Calibre's recipe could be modified to look for folders other than 'Read Later'. And maybe the simplest solution is for users to use custom recipes, one for each Instapaper folder.
flyash 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 09:42 AM.


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