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 11-23-2009, 09:23 AM   #886
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,384
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@Spankpoo: Just override get_article_url and return None for those articles you want to exclude.
kovidgoyal is offline  
Old 11-23-2009, 10:08 AM   #887
evanmaastrigt
Connoisseur
evanmaastrigt doesn't litterevanmaastrigt doesn't litter
 
Posts: 78
Karma: 192
Join Date: Nov 2009
Device: Sony PRS-600
recipe for nrcnext

Here is a new recipe for nrcnext, a newsblog from Dutch daily newspaper nrcnext. It does not use their RSS feeds because these are sometimes out of date (specially in the morning).

nrcnext.zip
evanmaastrigt is offline  
Old 11-23-2009, 12:47 PM   #888
Spankypoo
Enthusiast
Spankypoo ought to be getting tired of karma fortunes by now.Spankypoo ought to be getting tired of karma fortunes by now.Spankypoo ought to be getting tired of karma fortunes by now.Spankypoo ought to be getting tired of karma fortunes by now.Spankypoo ought to be getting tired of karma fortunes by now.Spankypoo ought to be getting tired of karma fortunes by now.Spankypoo ought to be getting tired of karma fortunes by now.Spankypoo ought to be getting tired of karma fortunes by now.Spankypoo ought to be getting tired of karma fortunes by now.Spankypoo ought to be getting tired of karma fortunes by now.Spankypoo ought to be getting tired of karma fortunes by now.
 
Posts: 29
Karma: 499348
Join Date: Jun 2009
Device: Myriad
Quote:
Originally Posted by kovidgoyal View Post
@Spankpoo: Just override get_article_url and return None for those articles you want to exclude.
Thanks! And if I want to include anything containing a string?
Spankypoo is offline  
Old 11-23-2009, 01:00 PM   #889
evanmaastrigt
Connoisseur
evanmaastrigt doesn't litterevanmaastrigt doesn't litter
 
Posts: 78
Karma: 192
Join Date: Nov 2009
Device: Sony PRS-600
Quote:
Originally Posted by fortunados View Post
If anyone could cook a recipe of just give me any hints I would apprecciate.
Well, it turns out to be very simple after all. All the RSS feeds of this paper have a typo: they have a double slash in them. Most browsers ignore that, but Calibre's browser does not. If you correct it, it becomes a very simple recipe.

farodevigo.zip

About that flash movie: you don't get to see it because you are a regular visitor; it is only shown to new visitors. But what happens is that in fact the whole page is loaded, and some javascript overlayers the page with that movie if some cookie is not set. But that's a guess, their code is in Spanish, and my Spanish is not what it used to be.

Feel free to post back your final recipe if might interest other people.
evanmaastrigt is offline  
Old 11-24-2009, 03:57 PM   #890
fortunados
Junior Member
fortunados began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Oct 2009
Device: PRS-505
Thanks a lot for you effort !!!!!!!!

I am going to try right away and come back...

I did it. I checked it , It was so easy, but what is unabelieveble for me is
How did you realize ???

I was even checking the page with telnet with my limited knoledges.

I will coock a recipe with th rest of the sections, not very nive formatted as I dont have idea about but for sure withh all the sections.

Once again thank a lot for solving this problem that drove me crazy for days.!!!!

Quote:
Originally Posted by evanmaastrigt View Post
Well, it turns out to be very simple after all. All the RSS feeds of this paper have a typo: they have a double slash in them. Most browsers ignore that, but Calibre's browser does not. If you correct it, it becomes a very simple recipe.

Attachment 39876

About that flash movie: you don't get to see it because you are a regular visitor; it is only shown to new visitors. But what happens is that in fact the whole page is loaded, and some javascript overlayers the page with that movie if some cookie is not set. But that's a guess, their code is in Spanish, and my Spanish is not what it used to be.

Feel free to post back your final recipe if might interest other people.

Last edited by fortunados; 11-24-2009 at 05:13 PM.
fortunados is offline  
Old 11-25-2009, 09:11 AM   #891
Swoard
Junior Member
Swoard began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Nov 2009
Device: PRS-505
Das meint der Meyer

Hi,

may be someone can help with this one:
http://frank-meyer.eu/blog/
and here the rss feed: http://frank-meyer.eu/blog/index.php?tempskin=_rss2

I get the book made with the heading of each topic. :-)
But when I click the link, then it is empty. :-(
Calibre does not follow the link to extract the text.
May be someone can help.

Thanks
Swoard
Swoard is offline  
Old 11-25-2009, 03:25 PM   #892
evanmaastrigt
Connoisseur
evanmaastrigt doesn't litterevanmaastrigt doesn't litter
 
Posts: 78
Karma: 192
Join Date: Nov 2009
Device: Sony PRS-600
recipe for levante

Here is a new recipe for the Spanish newspaper Levante. Just comment out the feeds you don't want. By 'comment out' I mean putting a single '#' in front of the appropriate 'feeds.append(...) line.

There is one issue: feed titles are without accented characters. Once you have the recipe in calibre you will have to correct it there. This has something to do with my editor. I will look into it later.

levante.zip
evanmaastrigt is offline  
Old 11-25-2009, 03:54 PM   #893
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,384
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Safest way to handle special characters in python scripts is to just use the encoded for like this u'a\u0062cd' where \u0062 is the code for b
kovidgoyal is offline  
Old 11-25-2009, 04:11 PM   #894
evanmaastrigt
Connoisseur
evanmaastrigt doesn't litterevanmaastrigt doesn't litter
 
Posts: 78
Karma: 192
Join Date: Nov 2009
Device: Sony PRS-600
Quote:
Originally Posted by kovidgoyal View Post
Safest way to handle special characters in python scripts is to just use the encoded for like this u'a\u0062cd' where \u0062 is the code for b
Muchas Gracias for the tip
evanmaastrigt is offline  
Old 11-25-2009, 11:01 PM   #895
dogncow
Junior Member
dogncow began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2009
Device: Kindle DX
First of all, I want to give a big THANK YOU to Kovid Goyal and everybody who help making calibre.

Calibre includles the recipe for 'the Economist' but this recipe is only available for Economist subscribers who can access 'printed edidtion' pages.

Because my subscribtion just expired few days ago, I tried to access other pages and I found this RSS page. Everybody can access this RSS page.

http://feeds.feedburner.com/economis..._print_edition

It has descriptions of latest news and links to 'full articles.' It would great if Calibre recognizes the list of latest news and downloads its full articles. This RSS page might be worse than the 'printed edition' page, but it is still good news source for poor people who dosen't have subscibtion. :-)
If anyone has time to take a look at this one. I'd appreciate it. Thanks!
dogncow is offline  
Old 11-26-2009, 03:03 PM   #896
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,384
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@dogncow: Sure will be in next release.
kovidgoyal is offline  
Old 11-27-2009, 12:57 AM   #897
dogncow
Junior Member
dogncow began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2009
Device: Kindle DX
Thank you so much

Quote:
Originally Posted by kovidgoyal View Post
@dogncow: Sure will be in next release.
Thank you very much. I'll look forward to next version.
dogncow is offline  
Old 11-27-2009, 01:26 AM   #898
fortunados
Junior Member
fortunados began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Oct 2009
Device: PRS-505
Well I have tryed the recipe and is working ok with all the sections. It is not perfect formatted and I don´t know what most of the sections does but is working, and even if it is a local newspaper I put ut here just in case Someone is interested.

It is normal that takes so long to get the recipe ?

It is there any way to get the recipe cooked in EPUB even if the default settings for calibre is LRF ??



Las section of def preprocess_html I don't know what is doing but I realized the many of the recipes have the section so I used it.

Even if remove_tags is empty I left it there just in case that in the future something not whised appears on the result.

Thanks

Recipe

Code:
#!/usr/bin/env  python

__license__   = 'GPL v3'
__copyright__ = '2009, Jos <nomedeslabrasa at gmail.com>'
'''
elmundo.es
'''

from calibre.web.feeds.news import BasicNewsRecipe

class FarodeVigo(BasicNewsRecipe):
    title                 = 'Faro de Vigo'
    __author__            = 'Jos'
    description           = 'Noticias de Vigo'
    publisher             = 'Faro de Vigo'
    category              = 'Noticias'
    oldest_article        = 7
    max_articles_per_feed = 100
    no_stylesheets        = True
    use_embedded_content  = False
    encoding              = 'latin1'
    cover_url             = 'http://www.farodevigo.es/elementosWeb/mediaweb/images/iconos/logo2.jpg'
    remove_javascript     = True

    html2lrf_options = [
                          '--comment', description
                        , '--category', category
                        , '--publisher', publisher
                        ]

    html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'


    keep_only_tags = [dict(name='div', attrs={'class' : 'noticia_titular'}),
                              dict(name='div', attrs={'class' : 'subtitulo'}),
                              dict(name='div', attrs={'class' : 'cuadro_multimedia'}),
                              dict(name='div', attrs={'id' : 'noticia_texto', 'class' : 'noticia_texto'})]
    remove_tags = [
                  ]

    feeds = [ (u'Vigo', u'http://www.farodevigo.es/elementosInt/rss/1'					)
				,(u'Gran Vigo', u'http://www.farodevigo.es/elementosInt/rss/2'				)
				,(u'Al minuto', u'http://www.farodevigo.es/elementosInt/rss/AlMinuto'		)
				,(u'Galicia', u'http://www.farodevigo.es/elementosInt/rss/4'				)
				,(u'Comarcas', u'http://www.farodevigo.es/elementosInt/rss/3'				)
				,(u'Pontevedra', u'http://www.farodevigo.es/elementosInt/rss/15'			)
				,(u'Ourense', u'http://www.farodevigo.es/elementosInt/rss/16'				)
				,(u'Arosa', u'http://www.farodevigo.es/elementosInt/rss/17'				)
				,(u'Morrazo', u'http://www.farodevigo.es/elementosInt/rss/18'				)
				,(u'Deza-Tabeirós-Montes', u'http://www.farodevigo.es/elementosInt/rss/19'	)
				,(u'España', u'http://www.farodevigo.es/elementosInt/rss/6'				)
				,(u'Mundo', u'http://www.farodevigo.es/elementosInt/rss/7'					)
				,(u'Opinión', u'http://www.farodevigo.es/elementosInt/rss/5'				)
				,(u'Economía', u'http://www.farodevigo.es/elementosInt/rss/10'				)
				,(u'Sociedad y Cultura', u'http://www.farodevigo.es/elementosInt/rss/8'	)
				,(u'Sucesos', u'http://www.farodevigo.es/elementosInt/rss/9'				)
				,(u'Deportes', u'http://www.farodevigo.es/elementosInt/rss/11'				)
				,(u'Agenda', u'http://www.farodevigo.es/elementosInt/rss/21'				)
				,(u'Gente', u'http://www.farodevigo.es/elementosInt/rss/24'				)
				,(u'Televisión', u'http://www.farodevigo.es/elementosInt/rss/25'			)
				,(u'Ciencia y tecnología', u'http://www.farodevigo.es/elementosInt/rss/26'	)
				,(u'Humor', u'http://www.farodevigo.es/elementosInt/rss/12'				)
				,(u'Última', u'http://www.farodevigo.es/elementosInt/rss/13'				)
				,(u'Cartas', u'http://www.farodevigo.es/elementosInt/rss/20'				)
            ]

    def preprocess_html(self, soup):
        for item in soup.findAll(style=True):
            del item['style']
        return soup

    language = 'es'

Last edited by mtravellerh; 11-27-2009 at 01:29 AM.
fortunados is offline  
Old 11-27-2009, 09:37 PM   #899
olaf
Enthusiast
olaf is on a distinguished road
 
Posts: 43
Karma: 50
Join Date: May 2009
Device: Kindle3
Question - is there a way to directly copy a calibre-created newspaper to the Kindle, and have previous versions go to the archive? If I email to my Kindle address, it will do that (for a fee each day), but other than naming the issue differently (like appending the date), I don't know if there's a way to do it with a copy via cable, without simply overlaying the issue that was there.
olaf is offline  
Old 11-27-2009, 09:41 PM   #900
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,384
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
each new download should have a different filename.
kovidgoyal 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 06:09 AM.


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