03-15-2022, 11:53 AM | #1 |
Junior Member
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') ] |
03-16-2022, 03:15 AM | #2 |
Fanatic
Posts: 564
Karma: 82944
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 03:20 AM. |
Advert | |
|
03-16-2022, 04:39 AM | #3 |
Junior Member
Posts: 2
Karma: 10
Join Date: Mar 2022
Device: kobo elipsa
|
|
Tags |
envelope, image, recipe, rss, xml |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Recipe to read article body from xml rss feed | Rasheedgm | Recipes | 2 | 01-23-2017 02:47 PM |
In same recipe, different from each other limitations for every rss feed??? | akmeltem | Recipes | 2 | 01-10-2017 05:15 PM |
Recipe without rss feed? | nicolash | Recipes | 10 | 09-09-2012 07:35 AM |
RSS FEED/ RECIPE for 365tomorrows.com | earl412 | Recipes | 9 | 06-29-2012 02:55 PM |
RECIPE Request: MLB.COM RSS Feed | fung | Recipes | 0 | 03-27-2011 12:42 AM |