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

<channel>
	<title>&#62;dade &#187; script</title>
	<atom:link href="http://www.creamdesign.it/blog/archives/tag/script/feed" rel="self" type="application/rss+xml" />
	<link>http://www.creamdesign.it/blog</link>
	<description>plans that either come to naught, or half a page of scribbled lines</description>
	<lastBuildDate>Sat, 30 Oct 2010 14:27:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Massive iTunes lyrics update</title>
		<link>http://www.creamdesign.it/blog/archives/37</link>
		<comments>http://www.creamdesign.it/blog/archives/37#comments</comments>
		<pubDate>Fri, 17 Jul 2009 21:22:18 +0000</pubDate>
		<dc:creator>dade</dc:creator>
				<category><![CDATA[iPod & iPhone]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[iTunes]]></category>
		<category><![CDATA[Lyrics]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.creamdesign.it/blog/?p=37</guid>
		<description><![CDATA[A Ruby script to download and add the lyrics for multiple songs in iTunes. No more blank lyrics on the iPod!]]></description>
			<content:encoded><![CDATA[<div style="display: block; padding: 10px; border: 2px solid #afa; background-color: #efe; margin-bottom: 1.2em;"><strong>UPDATE</strong>: since there were some problems with appscript and the whole ruby script method wasn&#8217;t that user-friendly, I&#8217;ve made an osx app to do the work. You can find it <a href="http://www.creamdesign.it/blog/archives/280" target="_self">here</a></div>
<p>I recently found a fantastic website to get lyrics for songs: <a title="lyricwiki" href="http://lyricwiki.org/Main_Page">lyricwiki.org<br />
</a>No ads and plenty of lyrics available for free, even for italian artists or pretty unknown songs.<span style="text-decoration: line-through;"> I was also pleased to discover that the website offers an handy REST interface to fetch (or upload) lyrics from scripts </span> update: I found a workaround to retrieve the lyrics without the banned lyricwiki API: <a href="http://www.creamdesign.it/blog/archives/108">read more here</a>.</p>
<p>So I coded a script to fetch and update the lyrics for the selected songs in iTunes automatically. It cycles through all the selected songs and if it finds the lyrics on lyricwiki it puts them into the corresponding field of the iTunes track. I tested the script on my whole library and &#8211; after 5 minutes &#8211; most of my tracks had lyrics attached.</p>
<p><img class="aligncenter size-full wp-image-36" src="http://www.creamdesign.it/blog/wp-content/uploads/2009/07/Picture-3-copy.png" alt="massivelyrics" width="578" height="386" /> <span id="more-37"></span> For that massive update task I found applescript to be a very quirky programming language. The folks at <a title="appscript" href="http://appscript.sourceforge.net/index.html">appscript</a> realized this long before me and coded a ruby binding for the applescript object model.<br />
Ruby was far more intuitive, and definitely replaced the need for applescript.</p>
<p>If you want to run the script you should also have the appscript and the curb (for curl support) gems installed: type this into a terminal to be up and running:</p>
<p><code>sudo gem install rb-appscript<br />
sudo gem install curb</code></p>
<p>The script is available for download both as a plain .rb file and as a self-contained application (thanks to <a href="http://www.sveinbjorn.org/platypus">platypus</a>)</p>
<p><strong>Usage:</strong></p>
<ol>
<li>install the appscript and curb gems (one time)</li>
<li>open iTunes and select the songs you want to fetch lyrics for.<br />
hint: command-a selects all your library</li>
<li>execute the script:<br />
either launch the application<br />
or run <code>ruby MassiveLyrics.rb</code> inside a terminal</li>
</ol>
<p>If you feel that your iPod hasn&#8217;t been the same as before after having all your favorite songs with lyrics, contribute the lyrics they don&#8217;t have on <a title="lyricwiki" href="http://lyricwiki.org/Main_Page">lyricwiki.org</a>!</p>
<p><a href="http://www.creamdesign.it/blog/wp-content/uploads/2009/07/MassiveLyrics.rb">MassiveLyrics ruby script (OS X &#8211; win &#8211; linux)</a></p>
<div style="display: block; padding: 10px; border: 2px solid #afa; background-color: #efe; margin-bottom: 1.2em;"><strong>UPDATE</strong>: since there were some problems with appscript and the whole ruby script method wasn&#8217;t that user-friendly, I&#8217;ve made an osx app to do the work. You can find it <a href="http://www.creamdesign.it/blog/archives/280" target="_self">here</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.creamdesign.it/blog/archives/37/feed</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
	</channel>
</rss>

