<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>Software As She's Developed &#187; bashpodder</title>
	<atom:link href="http://softwareas.com/tag/bashpodder/feed" rel="self" type="application/rss+xml" />
	<link>http://softwareas.com</link>
	<description>Mahemoff's Podcast/Blog - Web, Programming, Usability from the Author of 'Ajax Design Patterns' (AjaxPatterns.org)</description>
	<lastBuildDate>Mon, 26 Jul 2010 16:52:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<!-- podcast_generator="podPress/8.8" - maintenance_release="8.8.4" -->
		<copyright>Copyright &amp;#xA9; Software As She's Developed 2010 </copyright>
		<managingEditor>michael@mahemoff.com (Software As She's Developed)</managingEditor>
		<webMaster>michael@mahemoff.com (Software As She's Developed)</webMaster>
		<category>posts</category>
		<ttl>1440</ttl>
		<itunes:keywords></itunes:keywords>
		<itunes:subtitle></itunes:subtitle>
		<itunes:summary>Mahemoff's Podcast/Blog - Web, Programming, Usability from the Author of 'Ajax Design Patterns' (AjaxPatterns.org)</itunes:summary>
		<itunes:author>Software As She's Developed</itunes:author>
		<itunes:category text="Society &amp; Culture"/>
		<itunes:owner>
			<itunes:name>Software As She's Developed</itunes:name>
			<itunes:email>michael@mahemoff.com</itunes:email>
		</itunes:owner>
		<itunes:block>No</itunes:block>
		<itunes:explicit>no</itunes:explicit>
		<itunes:image href="http://softwareas.com/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<image>
			<url>http://softwareas.com/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
			<title>Software As She's Developed</title>
			<link>http://softwareas.com</link>
			<width>144</width>
			<height>144</height>
		</image>
		<item>
		<title>BashPodder mod &#8211; add podcasts to iTunes</title>
		<link>http://softwareas.com/bashpodder-mod-add-podcasts-to-itunes</link>
		<comments>http://softwareas.com/bashpodder-mod-add-podcasts-to-itunes#comments</comments>
		<pubDate>Thu, 04 Dec 2008 02:09:50 +0000</pubDate>
		<dc:creator>mahemoff</dc:creator>
				<category><![CDATA[SoftwareDev]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[bashpodder]]></category>
		<category><![CDATA[itunes]]></category>
		<category><![CDATA[Podcast]]></category>
		<category><![CDATA[Podcasting]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://softwareas.com/?p=496</guid>
		<description><![CDATA[

As a podcatcher (among other things), iTunes sucks. Badly. iPodder is nicer, mainly because I can keep my follow list in the cloud at PodNova. However, it (or the combination with podnova) often ends up downloading gigs of old stuff, on some particular feeds. Worse, it consumes obscene quantities of memory and CPU, with its [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.gizmodo.com.au/2008/04/review_lasonic_i931_ipod_ghetto_blaster_verdict_awesome-2.html"><img src="http://picupper.com/2008/12/03/lasonici9312_medium.jpg" style="width:380px;"/></a></p>

<p>As a podcatcher (<a href="http://softwareas.com/seven-things-about-itunes-that-are-just-plain-wrong">among other things</a>), iTunes sucks. Badly. <a href="http://juicereceiver.sourceforge.net/ ">iPodder</a> is nicer, mainly because I can keep my follow list in the cloud at <a href="http://www.podnova.com/">PodNova</a>. However, it (or the combination with podnova) often ends up downloading gigs of old stuff, on some particular feeds. Worse, it consumes obscene quantities of memory and CPU, with its UI being unresponsive to the point of being unusable, like 30 second or more delays for each gesture. This is on an early macbook.</p>

<p>Anyway, I decided to rectify the situation and go back to bashpodder, a tiny shell script which proves the point that a podcatcher need not be grandiose, nor a resource gobbler. It's also cool as it's easily customisable for anyone with some bash-fu. <a href="http://softwareas.com/bashpodder-praise-and-roaming-feed-profile">I modded it a few years back</a> to keep my follow list in the cloud. (I believe clouds were called "servers" back then.)</p>

<p>I've recently modded bashpodder to add files to iTunes. Yes, I still like iTunes and I definitely like the i* players which are, for most intents and purposes, constrained to the universe of iTunes. As for it's podcatcher, not cool. The interface for exploring podcasts is cumbersome, and the result, the downloaded podcasts, are not handle with care. For example, if you download podcasts with iTunes, it marks them out specially as podcasts, and there's no way to, say, delete all podcasts older than a week. If they're normal tracks added from an external catcher, they're just regular MP3s and you can do what you like with them. And you can't keep your follow list in the cloud!</p>

<p>So here's bashpodder modified to add to itunes. (The itunes part I added is the HERE doc section beginning with /usr/bin/osascript. You could easily extend it to, say, tag podcasts from certain feeds with a certain album name.)</p>

<p>Click on "Plain Text" and cut-and-paste it into a shell file. Easiest would be to download the several files required for <a href="http://www.lincgeek.org/bashpodder/">bashpodder</a> (there should be a mod to make it just a single self-modifying file), and replace bashpodder.shell contents with that below.</p>

<div class="igBar"><span id="ljavascript-2"><a href="#" onclick="javascript:showPlainTxt('javascript-2'); return false;">PLAIN TEXT</a></span></div>

<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span><br /><div id="javascript-2">
<div class="javascript"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#!<span style="color: #0066FF;">/bin/</span>bash</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># By Linc <span style="color: #CC0000;color:#800000;">10</span><span style="color: #0066FF;">/<span style="color: #CC0000;color:#800000;">1</span>/</span><span style="color: #CC0000;color:#800000;">2004</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># Find the latest script at http:<span style="color: #009900; font-style: italic;">//linc.homeunix.org:8080/scripts/bashpodder</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># Revision <span style="color: #CC0000;color:#800000;">1</span>.<span style="color: #CC0000;color:#800000;">2</span> <span style="color: #CC0000;color:#800000;">09</span><span style="color: #0066FF;">/<span style="color: #CC0000;color:#800000;">14</span>/</span><span style="color: #CC0000;color:#800000;">2006</span> - Many Contributers!</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># <span style="color: #000066; font-weight: bold;">If</span> you <span style="color: #003366; font-weight: bold;">use</span> <span style="color: #000066; font-weight: bold;">this</span> and have made improvements or have comments</div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># drop me an email at linc dot fessenden at gmail dot com</div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># I<span style="color: #3366CC;">'d appreciate it!</span></div></li>
<li style="font-weight: bold;color:#26536A;"></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;"># Make script crontab friendly:</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">cd $(dirname $0)</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;"># datadir is the directory you want podcasts saved to:</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">datadir=$(date +%Y-%m-%d)</span></div></li>
<li style="font-weight: bold;color:#26536A;"></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;"># create datadir if necessary:</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">mkdir -p $datadir</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;"># Delete any temp file:</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">rm -f temp.log</span></div></li>
<li style="font-weight: bold;color:#26536A;"></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;"># Read the bp.conf file and wget any url not already in the podcast.log file:</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">while read feed</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; do</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; podcast=`echo $feed | cut -f 1 -d '</span> <span style="color: #3366CC;">'`</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; echo $podcast</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; file=$(xsltproc parse_enclosure.xsl $podcast 2&gt; /dev/null || wget -q $podcast -O - | tr '</span>\r<span style="color: #3366CC;">' '</span>\n<span style="color: #3366CC;">' | tr <span style="color: #000099; font-weight: bold;">\'</span> <span style="color: #000099; font-weight: bold;">\"</span> | sed -n '</span>s/.*url=<span style="color: #3366CC;">"<span style="color: #000099; font-weight: bold;">\(</span>[^"</span><span style="color: #66cc66;">&#93;</span>*\<span style="color: #66cc66;">&#41;</span><span style="color: #3366CC;">".*/<span style="color: #000099; font-weight: bold;">\1</span>/p')</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; for url in $file ; do</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; echo "</span>Retrieving $url<span style="color: #3366CC;">"</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; echo $url&gt;&gt; temp.log</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; if ! grep "</span>$url<span style="color: #3366CC;">" podcast.log&gt; /dev/null</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; then</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; # wget -t 10 -U BashPodder -c -q -O $datadir/$(echo "</span>$url<span style="color: #3366CC;">" | awk -F'/' {'print $NF'} | awk -F'=' {'print $NF'} | awk -F'?' {'print $1'}) "</span>$url<span style="color: #3366CC;">"</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; outpath=$datadir/$(echo "</span>$url<span style="color: #3366CC;">" | awk -F'/' {'print $NF'} | awk -F'=' {'print $NF'} | awk -F'?' {'print $1'})</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; curl --retry 10 -C - $url&gt; $outpath</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; fullpath=`pwd`/"</span>$outpath<span style="color: #3366CC;">"</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; /usr/bin/osascript &lt;&lt;-EOF</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; tell application "</span>iTunes<span style="color: #3366CC;">"</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set posix_path to "</span>$fullpath<span style="color: #3366CC;">"</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set mac_path to posix_path as POSIX file</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set new_track to add mac_path</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set genre of new_track to "</span>*Podcast<span style="color: #3366CC;">"</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; end tell</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">EOF</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; fi</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; done</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; done &lt;bp.conf</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;"># Move dynamically created log file to permanent log file:</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">cat podcast.log&gt;&gt; temp.log </span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">sort temp.log | uniq&gt; podcast.log</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">rm temp.log</span></div></li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;"># Create an m3u playlist:</span></div></li>
<li style="font-weight: bold;color:#26536A;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">ls $datadir | grep -v m3u&gt; $datadir/podcast.m3u </span></div></li></ol></div>
</div></div>

<p><br /></p>

<p><a href="http://www.lincgeek.org/bashpodder/"><img style="width: 280px;" src="http://picupper.com/2008/12/03/bashpodder.png"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://softwareas.com/bashpodder-mod-add-podcasts-to-itunes/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
