Adding some listening material to an mp3 player for a long walk. Glad to see another episode to add to the collection!
Nice! Thanks for making us a part of your playlist!
Google Podcasts is being closed down on 24 June 2024, so have exported my subscription to YouTube Music (exports to any OPML podcast player). I'm now listening on YouTube music. Seems to be working well and have auto download for new episodes. Looks quite nice too.
I remember that I also have the back catalogue on the phone, played through VLC. Very useful when traveling
@jr0cket Very cool! How did you go about downloading the back catalog?
I downloaded one or two episode files individually, from the https://clojuredesign.club/ website. Usually Just before a walk. However after listening to the Spotify series, I am inspired to write some Clojure code to do the download for me, should I loose that data on the phone:grin:
Haha, I wrote a very hacky clojure script to download the back catalog!
@jr0cket https://clojuredesign.club/index.xml I look forward to seeing what you come up with!
@john.t.richardson.dev I'd love to see it.
It's horrible, just a fiddle file, but I'll post that here
(ns download
(:require [clojure.data.xml :as xml]))
(def tmp-feed (slurp ""))
tmp-feed
(def content-data (:content (reduce :content (:content (xml/parse-str tmp-feed)))))
content-data
(def items (filter #(= :item (:tag %)) content-data))
items
(filter
#(= (:tag %) :enclosure)
(:content (first items)))
(def all-mp3s (->> (map :content items)
(map #(filter (fn [x] (= (:tag x) :enclosure)) %))
(map #(map (fn [x] (get-in x [:attrs :url])) %))))
(defn copy-uri-to-file [uri file]
(with-open [in ( uri)
out ( file)]
( in out)))
(doseq [one-mp3 all-mp3s]
(prn one-mp3))
(doseq [one-mp3 all-mp3s]
(let [mp3 (first one-mp3)
file-name (last (clojure.string/split mp3 #"/"))]
(copy-uri-to-file mp3 file-name))
)
(map :url (map (comp :attrs)(filter
#(= (:tag %) :enclosure)
(:content (first items))))
)
(reduce #(= :content (:tag %)) items)
(filter #(= (:tag %) :enclosure) items)
(let [feed (slurp "")]
(str feed))
It just uses clojure.data.xml to get at the URLs and downloads them. Sorry about your eyes 👓
@john.t.richardson.dev Nice! Thanks for posting it! I love how non-general it is. It's just enough to get it working.
Also, I had no idea you could slurp a URL! What?! How have I never done that?!