Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 03-15-2022, 10:53 AM   #1
mauragio
Junior Member
mauragio began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Mar 2022
Device: kobo elipsa
Adnkronos RSS feed recipe (Italy version)

Hi all,
I'm new to Calibre. I would like to update embedded Adnkronos recipe, and I managed to do it successfully, but I've just one problem.
I'm not using embedded content, so I'm trying to get content from effective article's webpage. In the final ePub everything's correct, index, article title, body and so on. How can I add article's image? The image url in in <envelope> tag into RSS XML or as an <img...> tag inside article html, but I can't understand how to let it shows on ePub.

Can you help me, please?

Below you can find my recipe's code:

Code:
#!/usr/bin/env  python2
__license__ = 'GPL v3'
__author__ = 'Giovanni Mauramati, based on Gabriele Marini'
__copyright__ = '2009-2010, Darko Miletic <darko.miletic at gmail.com>'
description = 'Italian daily newspaper - updated on 03-15-2022'

'''
http://www.adnkronos.com/
'''

from calibre.web.feeds.news import BasicNewsRecipe


class Adnkronos(BasicNewsRecipe):
    __author__ = 'Giovanni Mauramati'
    description = 'News agency'
    cover_url = 'https://www.adnkronos.com/assets/themes/desktop/images/vector/logo-adnkronos.svg'
    title = u'Adnkronos'
    publisher = 'Adnkronos Group - News agency'
    category = 'News, politics, culture, economy, general interest'

    language = 'it'
    timefmt = '[%a, %d %b, %Y]'

    oldest_article = 7
    max_articles_per_feed = 80
    use_embedded_content = False
    recursion = 10

    remove_javascript = True

    def get_article_url(self, article):
        link = article.get('id', article.get('guid', None))
        return link

    extra_css = ' .ar-top{font-style: italic} '
    
    keep_only_tags = [dict(name='div', attrs={'class': ['arpage-head', 'ar-main', 'ar-top', 'loading', 'ar-bigimg']})
                      ]

    remove_tags = [
        dict(name='div', attrs={'class': ['ev-list', 'ar-leggi']})
    ]

    feeds = [
        (u'Prima Pagina', u'http://rss.adnkronos.com/RSS_PrimaPagina.xml')
        #,
        #(u'Ultima Ora', u'http://rss.adnkronos.com/RSS_Ultimora.xml'),
        #(u'Politica', u'http://rss.adnkronos.com/RSS_Politica.xml'),
        #(u'Esteri', u'http://rss.adnkronos.com/RSS_Esteri.xml'),
        #(u'Cronoca', u'http://rss.adnkronos.com/RSS_Cronaca.xml'),
        #(u'Economia', u'http://rss.adnkronos.com/RSS_Economia.xml'),
        #(u'Finanza', u'http://rss.adnkronos.com/RSS_Finanza.xml'),
        #(u'CyberNews', u'http://rss.adnkronos.com/RSS_CyberNews.xml'),
        #(u'Spettacolo', u'http://rss.adnkronos.com/RSS_Spettacolo.xml'),
        #(u'Cultura', u'http://rss.adnkronos.com/RSS_Cultura.xml'),
        #(u'Sport', u'http://rss.adnkronos.com/RSS_Sport.xml'),
        #(u'Sostenibilita', u'http://rss.adnkronos.com/RSS_Sostenibilita.xml'),
        #(u'Salute', u'http://rss.adnkronos.com/RSS_Salute.xml')
    ]
Thank you so much!
mauragio is offline   Reply With Quote
Old 03-16-2022, 02:15 AM   #2
unkn0wn
Evangelist
unkn0wn can do the Funky Gibbon.unkn0wn can do the Funky Gibbon.unkn0wn can do the Funky Gibbon.unkn0wn can do the Funky Gibbon.unkn0wn can do the Funky Gibbon.unkn0wn can do the Funky Gibbon.unkn0wn can do the Funky Gibbon.unkn0wn can do the Funky Gibbon.unkn0wn can do the Funky Gibbon.unkn0wn can do the Funky Gibbon.unkn0wn can do the Funky Gibbon.
 
Posts: 445
Karma: 82686
Join Date: May 2021
Device: kindle
you included class 'ar-bigimg' in dict name div

but in html its under dict name figure class 'ar-bigimg'

(ignore the article img from rss xml.)

Last edited by unkn0wn; 03-16-2022 at 02:20 AM.
unkn0wn is offline   Reply With Quote
Old 03-16-2022, 03:39 AM   #3
mauragio
Junior Member
mauragio began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Mar 2022
Device: kobo elipsa
Quote:
Originally Posted by unkn0wn View Post
you included class 'ar-bigimg' in dict name div

but in html its under dict name figure class 'ar-bigimg'

(ignore the article img from rss xml.)
U're right unKn0wn! Thank you so much!
mauragio is offline   Reply With Quote
Reply

Tags
envelope, image, recipe, rss, xml


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Recipe to read article body from xml rss feed Rasheedgm Recipes 2 01-23-2017 01:47 PM
In same recipe, different from each other limitations for every rss feed??? akmeltem Recipes 2 01-10-2017 04:15 PM
Recipe without rss feed? nicolash Recipes 10 09-09-2012 06:35 AM
RSS FEED/ RECIPE for 365tomorrows.com earl412 Recipes 9 06-29-2012 01:55 PM
RECIPE Request: MLB.COM RSS Feed fung Recipes 0 03-26-2011 11:42 PM


All times are GMT -4. The time now is 08:06 AM.


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