Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 05-02-2012, 05:42 AM   #1
atordo
Connoisseur
atordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to behold
 
Posts: 89
Karma: 19669
Join Date: Apr 2012
Device: Kindle Touch
Vice Magazine Spain

Spanish editon of Vice Magazine. It should be trivial to adapt for other language editions.

Code:
from calibre.web.feeds.news import BasicNewsRecipe

class ViceESRecipe(BasicNewsRecipe):
    title = u'Vice Magazine España'
    description = u'La página web oficial de la revista Vice España'
    category = u'noticias, fotografía, blogs, moda, arte, cine, música, literatura, tecnología'
    cover_url = 'http://www.seeklogo.com/images/V/Vice-logo-668578AC94-seeklogo.com.gif'
    oldest_article = 20
    max_articles_per_feed = 30
    auto_cleanup = True
    no_stylesheets = True
    language = 'es'

    feeds = [('Vice', 'http://www.vice.com/es/rss')]
atordo is offline   Reply With Quote
Old 06-06-2012, 01:57 PM   #2
atordo
Connoisseur
atordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to behold
 
Posts: 89
Karma: 19669
Join Date: Apr 2012
Device: Kindle Touch
Improved recipe with multipage support, better parsing and some CSS. Being a magazine and not a diary you should suit oldest_article to your downloading preferences (default two weeks).

Spoiler:
Code:
import re
from calibre.web.feeds.news import BasicNewsRecipe

class ViceESRecipe(BasicNewsRecipe):
    title = u'Vice Magazine España'
    description = u'La página web oficial de la revista Vice España'
    category = u'noticias, fotografía, blogs, moda, arte, cine, música, literatura, tecnología'
    cover_url = 'http://www.seeklogo.com/images/V/Vice-logo-668578AC94-seeklogo.com.gif'
    oldest_article = 14
    max_articles_per_feed = 100
    auto_cleanup = False
    no_stylesheets = True
    language = 'es'
    use_embedded_content  = False
    remove_javascript = True
    publication_type = 'magazine'

    recursions=10
    match_regexps = [r'/read/.*\?Contentpage=[2-9]$']

    keep_only_tags = [
        dict(attrs={'class':['article_title','article_content','next']})
    ]
    remove_tags = [
        dict(attrs={'class':['social_buttons','search','tweet','like','inline_socials'
           ,'stumblebadge','plusone']})
    ]

    extra_css = '''
        .author{font-size:small}
        img{margin-bottom: 0.4em; display:block; margin-left:auto; margin-right: auto}
    '''

    preprocess_regexps = [
        (re.compile(r'<img src="http://.*\.scorecardresearch\.com/'), lambda m: '')
    ]

    feeds = [('Vice', 'http://www.vice.com/es/rss')]

Last edited by atordo; 06-07-2012 at 12:25 PM.
atordo is offline   Reply With Quote
 
Enthusiast
Old 06-07-2012, 12:27 PM   #3
atordo
Connoisseur
atordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to behold
 
Posts: 89
Karma: 19669
Join Date: Apr 2012
Device: Kindle Touch
My bad, somehow the following lines got missed in the copypaste:
Code:
import re
from calibre.web.feeds.news import BasicNewsRecipe
They should go at the beginning of the recipe (previous post has been corrected).
atordo is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mobi to Epub or vice versa Kumabjorn Conversion 3 01-13-2012 12:17 PM
Newspaper/Magazine: Red & Black spain KRorschachZ Recipes 0 02-28-2011 10:28 PM
Russian to English and vice versa? afterry Ectaco jetBook 3 02-12-2010 06:47 AM
EPUB TO PDF AND VICE VERSA MSMYTH Sony Reader 2 01-10-2010 01:55 PM
Magazine FREEBIES - HUB magazine: Weekly Tales of SF Dr. Drib Deals, Freebies, and Resources (No Self-Promotion) 3 11-07-2009 12:07 PM


All times are GMT -4. The time now is 01:33 PM.


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