Since I’ve been using Google Reader for my feed-reading needs the last few months, I have been spoiled by Reader’s nonchalant handling of just about any feed I throw into it. It’s also available anywhere the internet is, which is very convenient for keeping breaks at work useful and non-boring. (The breaks that don’t involve food, anyway.) I also like the fact that “just about any feed” includes podcasts, so I have a convenient way to keep track of those at work as well.
Unfortunately, podcasts with Reader rely on frequent browser use – something I’m trying to limit – and a 6′ headphone tether to the computer. There is also no good way for Reader to sync with a portable device so podcasts can be heard sans computer with direct net connection.
My solution is to use RSSOwl with a couple custom filters and a custom batch script to sync to a removable USB device (my phone). Here’s how to do the magic and make your life easier.
This setup provides the following critical functions:
- Feed syncronization with Google Reader (built-in to RSSOwl)
- Automatic downloading of podcasts/media attachments on articles (RSSOwl filters)
- Syncronization of new downloads to removable device (Batch script)
- Automatic deletion of local files by the batch script, if they are removed from device (which I do after listening)
- Copy new items to device
- Maintain a local copy of files so I can listen to them on the computer
- If they are deleted from the device (i.e., listened to), delete from local folder
- Use only built-in commands – no need to install separate sync programs
- RSSOwl Downloads files to a “New files” folder
- The script copies all the files in the “New” folder to the device, then
- Moves them to the “Current” folder (leaving the “New” folder empty)
- Then the script compares the contents of the “Current” folder and the Device
- Files that do not exist on the device are deleted from the “Current” folder
The beauty of this system is that it doesn’t matter if we do the copy first or the compare first: both end up with the same result. And, thanks to Google and some batch scripting wizards on forums, this is all possible with built-in shell commands. The file comparison code is hacked up based on this forum thread (particularly message 5). Here’s a simplified version of my script:
@echo off setlocal echo PodSync v0.1 :: February 2012 :: This script is public domain, it being nothing very ground-breaking and the hard stuff :: came from http://forums.techguy.org/dos-other/704816-solved-batch-file-compares-contents.html :: Move to our working dir and set dir vars :: If working dir is not on the boot volume, add the /d flag cd c:\Documents and Settings\USER\My Documents\My Music\podsync\ set dirNEW=c:\Documents and Settings\USER\My Documents\My Music\podsync\new\ set dirCUR=c:\Documents and Settings\USER\My Documents\My Music\podsync\current\ set dirDEV=f:\Music\Podcasts\ :: Make sure dirs exist if not exist "%dirNEW%" echo dirNEW not found & goto :errors if not exist "%dirCUR%" echo dirCUR not found & goto :errors if not exist "%dirDEV%" echo Device not found & goto :errors :: Copy new podcasts to the device :: could just use copy here, drop the /e flag echo Dirs exist, copying to device... xcopy /e /y "%dirNEW%*.mp3" "%dirDEV%" :: Move new podcasts to the current folder, which indicates unlistened echo Moving new files to current... move /y "%dirNEW%*.mp3" "%dirCUR%" :: Now we magically compute the difference between Device and Current and delete :: files in Current that don't exist on the device :: Compare CUR with DEV, delete files in CUR that aren't in DEV echo Ready to compare and delete for /f "delims=" %%a in ('dir /b /a-d "%dirCUR%" 2^>NUL') do if not exist "%dirDEV%%%a" del "%dirCUR%%%a" :eof echo Thank you, have a nice day! pause exit :errors echo ERROR! pause
And there we are! Syncing my podcasts is a simple as plugging in my phone, running the script (which is made even simpler with Launchy), and waiting for it to finish.