<?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"
	>

<channel>
	<title>Strawp.net</title>
	<atom:link href="http://www.strawp.net/blog/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.strawp.net/blog</link>
	<description>*So* scripted</description>
	<pubDate>Thu, 26 Jun 2008 16:27:34 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>My Twitter client available for download</title>
		<link>http://www.strawp.net/blog/index.php/archive/my-twitter-client-available-for-download/</link>
		<comments>http://www.strawp.net/blog/index.php/archive/my-twitter-client-available-for-download/#comments</comments>
		<pubDate>Thu, 26 Jun 2008 16:27:34 +0000</pubDate>
		<dc:creator>Strawp</dc:creator>
		
		<category><![CDATA[Scripts]]></category>

		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.strawp.net/blog/?p=79</guid>
		<description><![CDATA[Somebody out there wants it, so here it is: My twitter cli client, written in PHP
&#8220;tw h&#8221; for help text.
]]></description>
			<content:encoded><![CDATA[<p>Somebody out there wants it, so here it is: <a href="http://www.strawp.net/files/download/tw_cli.zip">My twitter cli client, written in PHP</a></p>
<p>&#8220;tw h&#8221; for help text.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.strawp.net/blog/index.php/archive/my-twitter-client-available-for-download/feed/</wfw:commentRss>
		</item>
		<item>
		<title>My CLI client gets its own ascii Fail Whale</title>
		<link>http://www.strawp.net/blog/index.php/archive/my-cli-client-gets-its-own-ascii-fail-whale/</link>
		<comments>http://www.strawp.net/blog/index.php/archive/my-cli-client-gets-its-own-ascii-fail-whale/#comments</comments>
		<pubDate>Thu, 26 Jun 2008 15:27:12 +0000</pubDate>
		<dc:creator>Strawp</dc:creator>
		
		<category><![CDATA[Scripts]]></category>

		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.strawp.net/blog/?p=78</guid>
		<description><![CDATA[I&#8217;ve been using my own PHP-based CLI Twitter client pretty much since signing up (the Twitter API is so simple). You can view your timeline, tweet, view replies and view and send direct messages all via the command line, and I&#8217;ve just added the now-famous Fail Whale image to the error output, see this screenshot [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using my own PHP-based CLI <a href="http://twitter.com">Twitter</a> client pretty much since signing up (the Twitter API is so simple). You can view your timeline, tweet, view replies and view and send direct messages all via the command line, and I&#8217;ve just added the now-famous Fail Whale image to the error output, see <a href="http://www.strawp.net/images/view/screenshots/tw_cli_whale.png.html">this screenshot</a> for an example.</p>
<p>The source isn&#8217;t published at the moment, but if you want it I&#8217;ll clean it up (take out my hard-coded username and password) and upload it - just leave a comment.</p>
<p>The whale is based on <a href="http://www.geocities.com/SoHo/7373/aquatic.htm#whale">this one</a> which I turned into <a href="http://www.strawp.net/files/fail_whale.txt">my own version reversed with added twitter birdies</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.strawp.net/blog/index.php/archive/my-cli-client-gets-its-own-ascii-fail-whale/feed/</wfw:commentRss>
		</item>
		<item>
		<title>DRM, shmee-RM</title>
		<link>http://www.strawp.net/blog/index.php/archive/drm-shmee-rm/</link>
		<comments>http://www.strawp.net/blog/index.php/archive/drm-shmee-rm/#comments</comments>
		<pubDate>Mon, 09 Jun 2008 19:14:25 +0000</pubDate>
		<dc:creator>Strawp</dc:creator>
		
		<category><![CDATA[Scripts]]></category>

		<category><![CDATA[bbc]]></category>

		<category><![CDATA[iplayer]]></category>

		<guid isPermaLink="false">http://www.strawp.net/blog/?p=77</guid>
		<description><![CDATA[Looks like I overestimated the file encryption entirely on the last BBC update. Fortunately some people still had their own &#8220;clear&#8221; versions of some programs which they could compare directly with the newly encrypted downloads, noticing that what some of us thought was a DRM scheme was actually just a simple XOR of the video [...]]]></description>
			<content:encoded><![CDATA[<p>Looks like I overestimated the file encryption entirely on the last BBC update. Fortunately some people still had their own &#8220;clear&#8221; versions of some programs which they could compare directly with the newly encrypted downloads, noticing that what some of us thought was a DRM scheme was actually just a simple XOR of the video stream with two repeating bytes. A <a href="http://linuxcentre.net/iplayer_decode">quick perl script</a> later and P Lewis, posting on <a href="http://po-ru.com/diary/advantage-bbc/#comments">Paul&#8217;s blog</a> had a working video file just like the old scripts produced.</p>
<p>P Lewis has since incorporated this update into <a href="http://linuxcentre.net/get_iplayer">a really nice full featured script</a> for browsing and downloading video from iPlayer.</p>
<p>I really hope this update wasn&#8217;t what the iPlayer team were doing for the last couple of months. Bloody waste of license payer&#8217;s cash if it was.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.strawp.net/blog/index.php/archive/drm-shmee-rm/feed/</wfw:commentRss>
		</item>
		<item>
		<title>iPhone iPlayer hole gets DRM&#8217;d (no, properly this time)</title>
		<link>http://www.strawp.net/blog/index.php/archive/iphone-iplayer-hole-gets-drmd-no-properly-this-time/</link>
		<comments>http://www.strawp.net/blog/index.php/archive/iphone-iplayer-hole-gets-drmd-no-properly-this-time/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 15:02:46 +0000</pubDate>
		<dc:creator>Strawp</dc:creator>
		
		<category><![CDATA[Scripts]]></category>

		<category><![CDATA[bbc]]></category>

		<category><![CDATA[drm]]></category>

		<category><![CDATA[iplayer]]></category>

		<guid isPermaLink="false">http://www.strawp.net/blog/?p=76</guid>
		<description><![CDATA[It&#8217;s looking like files downloaded from the iPhone iPlayer interface are now unplayable on devices other than the iPhone. Previously this was wide open to allow anyone to download Quicktime (H.264) video over HTTP directly from the site, but it now appears that although the video can still be downloaded it is encrypted (probably with [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s looking like files downloaded from the iPhone <a href="http://www.bbc.co.uk/iplayer/">iPlayer</a> interface are now unplayable on devices other than the iPhone. Previously this was wide open to allow anyone to download Quicktime (H.264) video over HTTP directly from the site, but it now appears that although the video can still be downloaded it is encrypted (probably with Fairplay DRM).</p>
<p>More technical details on the <a href="http://beebhack.wikia.com/wiki/Beebhack#Update_to_video_file_encoding_as_of_6th_June_2008">Wiki</a> as they come in.</p>
<p>(See also <a href="http://po-ru.com/diary/advantage-bbc/">Paul Battley&#8217;s blog</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.strawp.net/blog/index.php/archive/iphone-iplayer-hole-gets-drmd-no-properly-this-time/feed/</wfw:commentRss>
		</item>
		<item>
		<title>While I&#8217;m at it: AAC to MP3 conversion script</title>
		<link>http://www.strawp.net/blog/index.php/archive/while-im-at-it-aac-to-mp3-conversion-script/</link>
		<comments>http://www.strawp.net/blog/index.php/archive/while-im-at-it-aac-to-mp3-conversion-script/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 15:49:59 +0000</pubDate>
		<dc:creator>Strawp</dc:creator>
		
		<category><![CDATA[Scripts]]></category>

		<category><![CDATA[aac]]></category>

		<category><![CDATA[bash]]></category>

		<category><![CDATA[mp3]]></category>

		<guid isPermaLink="false">http://www.strawp.net/blog/?p=75</guid>
		<description><![CDATA[Based on Converting FLAC to MP3 in Linux (I tweaked the LAME settings a bit though):
#!/bin/bash

# Converts all AAC (m4a) files in a folder into mp3s, plus the id3 tag
# Requires faad, lame, id3v2

for a in *
do
  # Check the file is a flac file
  if [[ "$a" =~ (m4a)$ ]]
  then
 [...]]]></description>
			<content:encoded><![CDATA[<p>Based on <a href="http://www.strawp.net/blog/index.php/archive/converting-flac-to-mp3-in-linux/">Converting FLAC to MP3 in Linux</a> (I tweaked the LAME settings a bit though):</p>
<pre>#!/bin/bash

# Converts all AAC (m4a) files in a folder into mp3s, plus the id3 tag
# Requires faad, lame, id3v2

for a in *
do
  # Check the file is a flac file
  if [[ "$a" =~ (m4a)$ ]]
  then
    # Name of outfile
    OUTF=`echo &#8220;$a&#8221; | sed s/\.m4a/.mp3/g`
    echo &#8220;$a => $OUTF&#8221;

    # Capture all the FLAC metadata
    ARTIST=`faad -i &#8220;$a&#8221; 2>&#038;1 | grep &#8220;^artist&#8221; | sed &#8220;s/.*: //g&#8221;`
    TITLE=`faad -i &#8220;$a&#8221; 2>&#038;1 | grep &#8220;^title&#8221; | sed &#8220;s/.*: //g&#8221;`
    ALBUM=`faad -i &#8220;$a&#8221; 2>&#038;1 | grep &#8220;^album&#8221; | sed &#8220;s/.*: //g&#8221;`
    GENRE=`faad -i &#8220;$a&#8221; 2>&#038;1 | grep &#8220;^genre&#8221; | sed &#8220;s/.*: //g&#8221;`
    TRACKNUMBER=`faad -i &#8220;$a&#8221; 2>&#038;1 | grep &#8220;^track&#8221; | sed &#8220;s/.*: //g&#8221;`
    YEAR=`faad -i &#8220;$a&#8221; 2>&#038;1 | grep &#8220;^date&#8221; | sed &#8220;s/.*: //g&#8221;`

    # echo &#8220;$ARTIST - $TITLE - $GENRE - $TRACKNUMBER&#8221;

    # Convert the audio data from AAC to MP3
    faad -w &#8220;$a&#8221; | lame -V 2 -m j -b 192 -B 224 -s 44.1 - &#8220;$OUTF&#8221;

    # Tag the resulting MP3 with the captured metadata
    id3v2 -t &#8220;$TITLE&#8221; -T &#8220;$TRACKNUMBER&#8221; -a &#8220;$ARTIST&#8221; -A &#8220;$ALBUM&#8221; -g &#8220;$GENRE&#8221; -y &#8220;$YEAR&#8221; &#8220;$OUTF&#8221;
  fi
done
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.strawp.net/blog/index.php/archive/while-im-at-it-aac-to-mp3-conversion-script/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Converting FLAC to MP3 in Linux</title>
		<link>http://www.strawp.net/blog/index.php/archive/converting-flac-to-mp3-in-linux/</link>
		<comments>http://www.strawp.net/blog/index.php/archive/converting-flac-to-mp3-in-linux/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 13:46:56 +0000</pubDate>
		<dc:creator>Strawp</dc:creator>
		
		<category><![CDATA[Scripts]]></category>

		<category><![CDATA[bash]]></category>

		<category><![CDATA[flac]]></category>

		<category><![CDATA[mp3]]></category>

		<guid isPermaLink="false">http://www.strawp.net/blog/?p=74</guid>
		<description><![CDATA[A quick howto&#8230;
If you&#8217;re using a desktop debian distro, just use SoundConverter:
sudo apt-get install soundconverter
If you&#8217;re shelling into a server (or you just prefer CLI), you&#8217;ll need a script and a few audio tools. Here&#8217;s the bash script (based on this one):
#!/bin/bash

# Converts all flac files in a folder into mp3s, plus the id3 tag
# [...]]]></description>
			<content:encoded><![CDATA[<p>A quick howto&#8230;</p>
<p>If you&#8217;re using a desktop debian distro, just use <a href="http://soundconverter.berlios.de/">SoundConverter</a>:</p>
<pre>sudo apt-get install soundconverter</pre>
<p>If you&#8217;re shelling into a server (or you just prefer CLI), you&#8217;ll need a script and a few audio tools. Here&#8217;s the bash script (based on <a href="http://ubuntuforums.org/showpost.php?p=352082&amp;postcount=5">this one</a>):</p>
<pre>#!/bin/bash

# Converts all flac files in a folder into mp3s, plus the id3 tag
# Requires flac, metaflac, lame, id3v2

for a in *
do
  # Check the file is a flac file
  if [[ "$a" =~ flac$ ]]
  then
    # Name of outfile
    OUTF=`echo &#8220;$a&#8221; | sed s/\.flac/.mp3/g`
    echo &#8220;$a => $OUTF&#8221;

    # Capture all the FLAC metadata
    ARTIST=`metaflac &#8220;$a&#8221; &#8211;show-tag=ARTIST | sed s/.*=//g`
    TITLE=`metaflac &#8220;$a&#8221; &#8211;show-tag=TITLE | sed s/.*=//g`
    ALBUM=`metaflac &#8220;$a&#8221; &#8211;show-tag=ALBUM | sed s/.*=//g`
    GENRE=`metaflac &#8220;$a&#8221; &#8211;show-tag=GENRE | sed s/.*=//g`
    TRACKNUMBER=`metaflac &#8220;$a&#8221; &#8211;show-tag=TRACKNUMBER | sed s/.*=//g`

    # Convert the audio data from FLAC to MP3
    flac -c -d &#8220;$a&#8221; | lame -m j -b 256 -s 44.1 - &#8220;$OUTF&#8221;

    # Tag the resulting MP3 with the captured metadata
    id3v2 -t &#8220;$TITLE&#8221; -T &#8220;$TRACKNUMBER&#8221; -a &#8220;$ARTIST&#8221; -A &#8220;$ALBUM&#8221; -g &#8220;$GENRE&#8221; &#8220;$OUTF&#8221;
  fi
done
</pre>
<p>Save that off in your path, make it executable:</p>
<pre>chmod u+wrx flac2mp3</pre>
<p>and run it from an location with mp3s in. It&#8217;ll convert all FLAC files to identically named MP3 files with the id3v2 information based on the FLAC metadata.</p>
<p>You&#8217;ll need flac, metaflac, id3v2 and lame:</p>
<pre>sudo apt-get install flac id3v2 lame</pre>
<p>Happy converting <img src='http://www.strawp.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.strawp.net/blog/index.php/archive/converting-flac-to-mp3-in-linux/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Beebhack moved to Wikia</title>
		<link>http://www.strawp.net/blog/index.php/archive/beebhack-moved-to-wikia/</link>
		<comments>http://www.strawp.net/blog/index.php/archive/beebhack-moved-to-wikia/#comments</comments>
		<pubDate>Mon, 02 Jun 2008 15:07:01 +0000</pubDate>
		<dc:creator>Strawp</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[bbc]]></category>

		<category><![CDATA[wiki]]></category>

		<guid isPermaLink="false">http://www.strawp.net/blog/?p=73</guid>
		<description><![CDATA[I had a very nice email from Angela at Wikia this morning, inviting me to move the Beebhack Wiki over to their hosting. I think the only reason Beebhack wasn&#8217;t over there in the first place was potential hassle around getting a free wiki approved by their staff. Since they&#8217;d been kind enough to email [...]]]></description>
			<content:encoded><![CDATA[<p>I had a very nice email from Angela at Wikia this morning, inviting me to move the Beebhack Wiki over to their hosting. I think the only reason Beebhack wasn&#8217;t over there in the first place was potential hassle around getting a free wiki approved by their staff. Since they&#8217;d been kind enough to email me over there, this was no longer a problem.</p>
<p>So, a good time to take advantage of a better implementation of MediaWiki than we had at BluWiki and hopefully some better uptime. Angela even imported all our existing wiki data for us.</p>
<p><a title="New wiki URL" href="http://beebhack.wikia.com">Beebhack.wikia.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.strawp.net/blog/index.php/archive/beebhack-moved-to-wikia/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Wii iPlayer, User Agents</title>
		<link>http://www.strawp.net/blog/index.php/archive/wii-iplayer-user-agents/</link>
		<comments>http://www.strawp.net/blog/index.php/archive/wii-iplayer-user-agents/#comments</comments>
		<pubDate>Wed, 09 Apr 2008 15:17:25 +0000</pubDate>
		<dc:creator>Strawp</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[bbc]]></category>

		<category><![CDATA[iplayer]]></category>

		<category><![CDATA[wii]]></category>

		<guid isPermaLink="false">http://www.strawp.net/blog/index.php/archive/wii-iplayer-user-agents/</guid>
		<description><![CDATA[The beeb added a little update to the iPlayer again today, clearly as part of their (admirable) attempts at getting iPlayer working on exotic devices iPlayer is now Wii optimised! How cool! I&#8217;ve not tested it out, but this is the first &#8220;official&#8221; iPlayer version which is actually designed to display TV shows on a [...]]]></description>
			<content:encoded><![CDATA[<p>The beeb added a little update to the iPlayer again today, clearly as part of their (admirable) attempts at getting iPlayer working on exotic devices iPlayer is now Wii optimised! How cool! I&#8217;ve not tested it out, but this is the first &#8220;official&#8221; iPlayer version which is actually designed to display TV shows on a TV. We are living in the future!</p>
<p>I&#8217;ve written a few technical notes over on the <a href="http://beebhack.bluwiki.com/#iPlayer_for_Nintendo_Wii">Wiki</a>, but basically they&#8217;re using the User-Agent string to serve a Flash 7 compatible stream.</p>
<p>Speaking of User-Agents, I&#8217;m hearing that the iPhone version of iPlayer has been tightening down on what User-Agent string you can get away with when you pretend to be an iPhone. No more &#8220;iPhone, LOL&#8221; strings I&#8217;m afraid <img src='http://www.strawp.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.strawp.net/blog/index.php/archive/wii-iplayer-user-agents/feed/</wfw:commentRss>
		</item>
		<item>
		<title>&#8220;One line&#8221; iPlayer download script</title>
		<link>http://www.strawp.net/blog/index.php/archive/one-line-iplayer-download-script/</link>
		<comments>http://www.strawp.net/blog/index.php/archive/one-line-iplayer-download-script/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 20:39:01 +0000</pubDate>
		<dc:creator>Strawp</dc:creator>
		
		<category><![CDATA[Scripts]]></category>

		<category><![CDATA[bash]]></category>

		<category><![CDATA[bbc]]></category>

		<category><![CDATA[curl]]></category>

		<category><![CDATA[cut]]></category>

		<category><![CDATA[grep]]></category>

		<category><![CDATA[iplayer]]></category>

		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://www.strawp.net/blog/index.php/archive/one-line-iplayer-download-script/</guid>
		<description><![CDATA[Thought I&#8217;d see if I could get a download script in just one line of console utilities. I could (although it&#8217;s actually 8 separate commands split over 12 lines, it&#8217;s still executed as one single bash statement). A pretty concise bit of code it is, too:

curl -b cookies.txt -A "Apple iPhone v1.1.3 CoreMedia v1.0.0.4A93" -H [...]]]></description>
			<content:encoded><![CDATA[<p>Thought I&#8217;d see if I could get a download script in just one line of console utilities. I could (although it&#8217;s actually 8 separate commands split over 12 lines, it&#8217;s still executed as one single bash statement). A pretty concise bit of code it is, too:</p>
<pre>
curl -b cookies.txt -A "Apple iPhone v1.1.3 CoreMedia v1.0.0.4A93" -H "Range: bytes=0-" -o iplayer_download.mov \
  $( \
    curl -i -c cookies.txt -A "Apple iPhone v1.1.3 CoreMedia v1.0.0.4A93" -H "Range: bytes=0-1" \
      $( \
        curl -i -A "iPhone, LOL" -c cookies.txt $1 \
        | grep "pid       :" \
        | cut -d\' -f2 \
        | sed "s/\([0-9a-z]\)/http:\/\/www.bbc.co.uk\/mediaselector\/3\/auth\/iplayer_streaming_http_mp4\/\1/&#8221; \
      ) \
    | grep Location \
    | cut -d: -f2,3 \
  )</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.strawp.net/blog/index.php/archive/one-line-iplayer-download-script/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New BBC Wiki</title>
		<link>http://www.strawp.net/blog/index.php/archive/new-bbc-wiki/</link>
		<comments>http://www.strawp.net/blog/index.php/archive/new-bbc-wiki/#comments</comments>
		<pubDate>Wed, 19 Mar 2008 17:14:11 +0000</pubDate>
		<dc:creator>Strawp</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[bbc]]></category>

		<category><![CDATA[wiki]]></category>

		<guid isPermaLink="false">http://www.strawp.net/blog/index.php/archive/new-bbc-wiki/</guid>
		<description><![CDATA[I&#8217;ve created a new wiki all about using BBC content at beebhack.bluwiki.com
In the first 24 hrs it got 1500 page requests and it&#8217;s not looking to slow down just yet. I would have hosted it here at Strawp.net but I wanted this to be more community owned than something I would run.
The downside of course [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve created a new wiki all about using BBC content at <a href="http://beebhack.bluwiki.com">beebhack.bluwiki.com</a></p>
<p>In the first 24 hrs it got 1500 page requests and it&#8217;s not looking to slow down just yet. I would have hosted it here at Strawp.net but I wanted this to be more community owned than something I would run.</p>
<p>The downside of course is that I really don&#8217;t have any detailed information on where any of those hits are coming from&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.strawp.net/blog/index.php/archive/new-bbc-wiki/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
