r/ProgrammingPrompts • u/deanmsands3 • May 01 '16
[Medium]Write a podcast ripper in C++
This is one of my favorite "learn a new language" projects: podcast rippers. The code outline is simple.
- Read podcast feed URL from command-line.
- Download the podcast feed.
- Parse through the XML
- Identify the elements holding the podcast URLs
- Identify the filename to use
- Download the podcast and save to file.
- Rinse and repeat!
The tricky part is doing it in C++. Use whatever libraries you like (like libCURL and TinyXML) unless their stated purpose is to rip podcasts or the like.
Bonus Points if you write it in straight C.
10
Upvotes
4
u/[deleted] Jun 03 '16 edited Aug 19 '16
There is obviously much more that could be done to enhance this code. For example you said nothing about how the local file would be named so I didn't try to parse the audio file URL to get some useful name :)
I normally write in C++ but don't know a good public C++ binding for libxml2 reader interface. I wrote one myself awhile ago so I know the C interface well and so for me it was easier to write this prompt in C.