Instant podcasts, in 50 lines of perl
I have a directory full of stuff that I've recorded off the radio. I'd like to listen to it on my phone on the way to work. And the most convenient way to do that is to create a podcast of that directory. That way, whenever I record more stuff, I just have to update the podcast and the files magically appear on my phone.
I am, of course, far too lazy to edit XML by hand, and I want something that will work in a terminal. I was surprised that I couldn't find anything like this. Well, I could. It was 1300 lines of PHP. I've not got anything against PHP, but 1300 lines of code for such a simple task? Really?
Here's my version. Tell it a source directory, a target directory, and the address of that directory in HTTP-land, and Bob's yer uncle.
Could you perhaps show us the 1300-line PHP version? :)
Sure. It does do a bit more than mine, but mine does what I need and I'm not sure that the extras are worth 1250 lines of code!
Or perhaps not. Silly website are the link. Here: https://github.com/ben-xo/dir2cast/blob/master/dir2cast.php
Here's my 140-line Ruby version :) It extracts mp3 EXIF to fill up iTunes metadata as well.
https://github.com/miyagawa/dircaster
Ugh, s/EXIF/ID3/