Audiobooks
Turn some audioboks resources into podcasts RSS
This page is mostly autogenerated from the http://litteratureaudio.com website.
They do a fantastic job reading books and publishing mp3 … in wordpress articles. As of today, I triod to reach them through their contact address to no avail.
I like the way http://librivox.org publishes books as an RSS feed, for everyone to enjoy in their favorite podcast player.
2 Create RSS from the website
RSS is a must have for audiobooks, to be able to keep track and sync between devices.
litteratureaudio.com is a sad wordpress instance with little to no automation options. The content seems to be mostly organized by hand. There is no apparent full RSS nor json, XML-RDF of any sort. To produce a RSS, we will need to first scrapt to goddam website.
2.1 Get the full list of books
http://www.litteratureaudio.com/notre-bibliotheque-de-livres-audio-gratuits is all we need. There are 10000+ books.
2.2 Handle the different kinds of books
Books aren't always laid out and structured the same.
Most books embed the mp3 list in a .link-roman-mp3-file
class container but if there is only one episode, then the mp3 link is just sitting
2.3 Extract more information about each book
Tags, author name, publication date, an image for the feed.
2.4 Validate the RSS to what apple requires
Use https://castfeedvalidator.com/ as it seems good enough for our needs.
3 Generate the RSS index JSON file for the search engine
here=`pwd` cd ~/public_html/audiobooks touch index.json echo -n "[" > index.json for file in `ls *.rss`; do parts=`echo $file | sed 's/[_,.]/ /g'` echo "{\"title\": \"$parts\", \"uri\": \"$file\"}," >> index.json done echo -n "{}]" >> index.json cp index.json $here/ exit 0