<?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; Coding</title>
	<atom:link href="http://www.creamdesign.it/blog/archives/category/coding/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>MassiveLyrics: get all the lyrics for your iTunes library</title>
		<link>http://www.creamdesign.it/blog/archives/280</link>
		<comments>http://www.creamdesign.it/blog/archives/280#comments</comments>
		<pubDate>Sun, 19 Sep 2010 10:35:38 +0000</pubDate>
		<dc:creator>dade</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[iPod & iPhone]]></category>

		<guid isPermaLink="false">http://www.creamdesign.it/blog/?p=280</guid>
		<description><![CDATA[Fill the lyrics of your entire iTunes library in one click with this OSX app. No more blank lyrics on the iPod!]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.creamdesign.it/blog/wp-content/uploads/2010/09/MassiveLyricsIcon.png"><img class="aligncenter size-full wp-image-281" title="MassiveLyricsIcon" src="http://www.creamdesign.it/blog/wp-content/uploads/2010/09/MassiveLyricsIcon.png" alt="App Icon" width="256" height="256" /></a></p>
<p>Have you ever found yourself missing the lyrics for a song in your iPod, but you don&#8217;t want to go search and add lyrics manually to each song in your iTunes library? Then this is the app for you!</p>
<p>It can update the lyrics field in iTunes for the currently selected songs, automatically. The lyrics are fetched from the <a title="lyricwiki" href="http://lyricwiki.org/Main_Page">lyricwiki.org</a> website, which has a pretty good library of songs, even though some of them have been obscured by a copyright claim.</p>
<p>This is how to use it:</p>
<h2>Step 1: select some songs in iTunes</h2>
<div id="attachment_282" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.creamdesign.it/blog/wp-content/uploads/2010/09/itunesSelection.png"><img class="size-medium wp-image-282" title="iTunes Selection" src="http://www.creamdesign.it/blog/wp-content/uploads/2010/09/itunesSelection-300x195.png" alt="iTunes Selection" width="300" height="195" /></a><p class="wp-caption-text">Select some songs in iTunes. (you can use command-a to select all songs on screen)</p></div>
<h2>Step 2: open MassiveLyrics and hit the Get button</h2>
<div id="attachment_283" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.creamdesign.it/blog/wp-content/uploads/2010/09/lyricsFetched.png"><img class="size-medium wp-image-283" title="Lyrics retrieved" src="http://www.creamdesign.it/blog/wp-content/uploads/2010/09/lyricsFetched-300x193.png" alt="Some lyrics retrieved in the app" width="300" height="193" /></a><p class="wp-caption-text">The lyrics have been looked up</p></div>
<p>The app will start looking up songs on the internet. If the lyrics are not available it will be shown, otherwise you&#8217;ll see &#8216;lyrics found&#8217;</p>
<h2>Step 3: push Write all found lyrics to iTunes to update the songs in your library</h2>
<p>Just the songs in the &#8216;lyrics found&#8217; state will be updated in your iTunes library. Song state will be updated to lyrics written.</p>
<p>Each of the previous three steps will take some time, depending on the size of the selection you&#8217;ve made. Please be patient while it loads</p>
<h2>Step 4: enjoy!</h2>
<p>You will find the newly added lyrics in the get-info dialog of your iTunes songs, under the lyrics tab, and next time you&#8217;ll sync your music player they will be copied and available also on the go.</p>
<p style="text-align: center;"><a class="bigbut_green" href="http://www.creamdesign.it/blog/wp-content/uploads/2010/09/massivelyrics_1.1.zip">Download massivelyrics v1.1</a></p>
<p>I have tested the app for some time on my mac, and it works fine.<br />
However it is provided AS-IS and I cannot be held responsible for any damage it may make.<br />
If you download lots of lyrics with this app, please consider buying me a coffee donating a small amount through the button in the app. Thank you!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.creamdesign.it/blog/archives/280/feed</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>Lyricwiki.org API ban workaround</title>
		<link>http://www.creamdesign.it/blog/archives/108</link>
		<comments>http://www.creamdesign.it/blog/archives/108#comments</comments>
		<pubDate>Tue, 04 Aug 2009 08:33:09 +0000</pubDate>
		<dc:creator>dade</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[iPod & iPhone]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.creamdesign.it/blog/?p=108</guid>
		<description><![CDATA[Lyrics can be fetched again from lyricwiki.org in spite of the ban of the API from major music producers. One more little victory of digital freedom]]></description>
			<content:encoded><![CDATA[<p>Lyrics can be fetched again from lyricwiki.org in spite of the ban of the API from major music producers. One more little victory of digital freedom!</p>
<p>Yesterday night I was so frustrated by my widget not working anymore that I had to find a solution. The workaround was very simple indeed: the lyricwiki.org lyrics pages have the author and the song title embedded in the URL of the page, with little or no difference from the previous REST method to access lyrics.</p>
<p>Check out the posts of the dashboard widget and the massive lyrics script for updates: I&#8217;m going to fix them soon so that they work again!</p>
<ul>
<li><a href="http://www.creamdesign.it/blog/archives/48">simple lyrics widget: dadelyrics</a></li>
<li><a href="http://www.creamdesign.it/blog/archives/37">massive iTunes lyrics download script</a></li>
</ul>
<p><span id="more-108"></span>The  only difference is that the output is now a full-fledged html page, and not the plain text of the lyrics. To strip the output some more ruby processing is required, basically a call to parse the DOM and extract the node with lyrics, plus some cleanup of the xhtml markup after the node is retrieved. But in more simple words <strong>it works again! </strong></p>
<p>Ruby has proven itself again simple, elegant and powerful: look at this one-liner:<br />
<code><br />
doc.root_node.find_first_recursive {|node| node.name == "div" and node.attributes["class"] == "lyricbox"}</code></p>
<p>It parses the html output and extracts the node with lyrics thanks to REXML, which comes bundles with ruby. Bliss!</p>
<p>Seems that the ban from music producer has little or no effect, unless they will decide to put down the site completely, but that is not likely to happen, fortunately.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.creamdesign.it/blog/archives/108/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Too good to be true</title>
		<link>http://www.creamdesign.it/blog/archives/72</link>
		<comments>http://www.creamdesign.it/blog/archives/72#comments</comments>
		<pubDate>Mon, 03 Aug 2009 13:20:21 +0000</pubDate>
		<dc:creator>dade</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[iPod & iPhone]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.creamdesign.it/blog/?p=72</guid>
		<description><![CDATA[LyricWiki.org API has been shut due restrictions from major music publishers. The posts which offered the dadelyrics widget and the massive lyrics update scripts won't have files to download anymore. ]]></description>
			<content:encoded><![CDATA[<p>Just as I was planning an update for my lyrics and scripts based on lyricwiki.org I ran across this annoying message inside my widget dadelyrics:</p>
<div id="attachment_73" class="wp-caption aligncenter" style="width: 456px"><a href="http://www.creamdesign.it/blog/wp-content/uploads/2009/08/Picture-1.png"><img class="size-full wp-image-73" title="Banned service" src="http://www.creamdesign.it/blog/wp-content/uploads/2009/08/Picture-1.png" alt="lyrics API banned!" width="446" height="256" /></a><p class="wp-caption-text">lyricwiki.org REST service has been banned!</p></div>
<p>I guess this will be the end of the project, unless I can find a similar service. I think however it will always be playing the rat and the mouse between the majors and who offers lyrics APIs.</p>
<p>Fortunately I could download all the lyrics in my iTunes library prior to this with my massive lyrics ruby script!</p>
<p>Well, it&#8217;s time to update the two posts removing the download of the programs that used the lyricwiki interface. Shame!</p>
<ul>
<li><a href="http://www.creamdesign.it/blog/archives/48">simple lyrics widget: dadelyrics</a></li>
<li><a href="http://www.creamdesign.it/blog/archives/37">massive iTunes lyrics download script</a></li>
</ul>
<p>Let&#8217;s hope that new and brilliant services like the ones from lyricwiki won&#8217;t be censored anymore.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.creamdesign.it/blog/archives/72/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Simple Lyrics Widget: dadelyrics</title>
		<link>http://www.creamdesign.it/blog/archives/48</link>
		<comments>http://www.creamdesign.it/blog/archives/48#comments</comments>
		<pubDate>Fri, 17 Jul 2009 21:53:43 +0000</pubDate>
		<dc:creator>dade</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[iPod & iPhone]]></category>

		<guid isPermaLink="false">http://www.creamdesign.it/blog/?p=48</guid>
		<description><![CDATA[This widget looks up the lyrics for the song currently being played in iTunes, either from the lyrics field of the current track or from the internet if you press the lightning button. That's it: no strings attached. ]]></description>
			<content:encoded><![CDATA[<div id="attachment_134" class="wp-caption aligncenter" style="width: 463px"><a href="http://www.creamdesign.it/blog/wp-content/uploads/2009/07/dadelyrics-widget.png"><img class="size-full wp-image-134" title="dadelyrics widget" src="http://www.creamdesign.it/blog/wp-content/uploads/2009/07/dadelyrics-widget.png" alt="a screenshot of the widget" width="453" height="260" /></a><p class="wp-caption-text">a screenshot of the widget </p></div>
<p>I built a simple lyrics widget playing around with dashcode. I&#8217;m sure there could be many improvements on the concept, but I wanted something as simple as possible to have quick and dirty dashboard lyrics.</p>
<p>It displays the lyrics from the current track playing in iTunes, taking them from the lyrics field.</p>
<p>The Lightning button will see if there is no lyric content in the iTunes song. If it is so, it interrogates lyricwiki.org and add the lyrics to the iTunes track.</p>
<p>in order to use the widget you have to run these commands in the terminal.</p>
<p><code>sudo gem install rb-appscript<br />
sudo gem install curb</code></p>
<p>To have all your songs with lyrics added automatically check out my <a href="http://www.creamdesign.it/blog/archives/37">massive lyrics update script</a>! Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.creamdesign.it/blog/archives/48/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<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>

