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 06-25-2017, 04:16 PM   #1
renis052
Junior Member
renis052 began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jun 2017
Device: Kindle Paperwhite 3
Dynamic categories

My favorite news website is 'delfi.lt' which mostly provides excellent RSS feeds. But in addition to them there are also 'RSS Index' feeds which contain some more categories in themselves.

An example of an 'RSS Index' feed for 'Mokslas' category:
http://www.delfi.lt/mokslas/rss/

This XML contains some additional dynamic categories (they are added or removed depending on current events in the world), such as 'Login 2017' or 'Sugalvota Lietuvoje', and links to their separate XMLs. However, calibre seems to treat XMLs of the additional categories as articles and the output in the final ebook is like this:

http://www.delfi.lt/mokslas/rss/feeds/login.xml http://www.delfi.lt/m360/naujausi-straipsniai/login-2017-pasibaigus-kas-labiausiai-istrigo-siais-metais.d?id=74797050&utm_source=rss&utm_medium=rss &utm_campaign=rss http://www.delfi.lt/m360/naujausi-straipsniai/login-2017-pasibaigus-kas-labiausiai-istrigo-siais-metais.d?id=74797050 http://www.delfi.lt/m360/naujausi-straipsniai/login-2017-pasibaigus-kas-labiausiai-istrigo-siais-metais.d?id=74797050&utm_source=rss&utm_medium=rss &utm_campaign=rss&com=1 Wed, 31 May 2017 09:38:49 +0300 http://www.delfi.lt/mokslas/login/papasakojo-apie-snipus-lietuvoje-kaip-jie-verbuoja.d?id=74779490&utm_source=rss&utm_medium=r ss&utm_campaign=rss http://www.delfi.lt/mokslas/login/papasakojo-apie-snipus-lietuvoje-kaip-jie-verbuoja.d?id=74779490 http://www.delfi.lt/mokslas/login/papasakojo-apie-snipus-lietuvoje-kaip-jie-verbuoja.d?

and so on.

How to convert these (sub)categories into proper categories?
renis052 is offline   Reply With Quote
Old 06-25-2017, 10:57 PM   #2
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: 43,857
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You can re-implement parse_feeds() in your recipe to do whatever you like with the XML.
kovidgoyal is offline   Reply With Quote
Advert
Old 06-26-2017, 02:51 PM   #3
renis052
Junior Member
renis052 began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jun 2017
Device: Kindle Paperwhite 3
Thanks for the reply. However, I should have mentioned that my knowledge of Python is quite limited, so I can't figure out how to use that function specifically to find and merge all articles from all subcategories from http://www.delfi.lt/mokslas/rss/ into a single category 'Mokslas'. Can you provide an example?
renis052 is offline   Reply With Quote
Old 06-26-2017, 03:21 PM   #4
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: 43,857
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Sorry, I dont have the time for that.
kovidgoyal is offline   Reply With Quote
Reply

Tags
news feed, news recipe


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking for help with Dynamic DNS Hampshire Nanny General Discussions 4 12-24-2016 09:11 PM
Dynamic fonts? Ghitulescu ePub 8 01-27-2015 01:10 PM
dynamic content manipulation maze ePub 1 02-15-2013 11:01 PM
Dynamic keymaps Mackx iRex Developer's Corner 42 04-25-2012 08:56 AM
0.7.47 - User Categories & Sub-Categories nynaevelan Library Management 0 02-28-2011 06:11 PM


All times are GMT -4. The time now is 02:44 AM.


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