<?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>Sebastian Oliva</title>
	<atom:link href="http://www.sebastianoliva.com/en/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sebastianoliva.com/en/</link>
	<description>mi Blag Personal</description>
	<lastBuildDate>Sat, 01 May 2010 07:07:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Using a Processing Sketch as a Java Component</title>
		<link>http://www.sebastianoliva.com/en/2010/05/using-a-processing-sketch-as-a-java-component/</link>
		<comments>http://www.sebastianoliva.com/en/2010/05/using-a-processing-sketch-as-a-java-component/#comments</comments>
		<pubDate>Sat, 01 May 2010 07:02:33 +0000</pubDate>
		<dc:creator>tian</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Geek Stuff]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[processing]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.sebastianoliva.com/?p=71</guid>
		<description><![CDATA[I really like Processing. Processing is a Visual Programming language, and it is based on Java. It is designed to run either as an Applet, a Standalone App, or as a Java Component; running a Processing Sketch as a Component is the one with less documentation, but probably one of the most interesting and powerful [...]]]></description>
			<content:encoded><![CDATA[<p>I really like <a href="http://processing.org"><em>Processing</em></a>. Processing is a Visual Programming language, and it is based on Java. It is designed to run either as an Applet, a Standalone App, or as a Java Component; running a Processing Sketch as a Component is the one with less documentation, but probably one of the most interesting and powerful applications of it.<br />
This is a small guide on setting up a Processing Sketch as a Java component, ready to use on your Swing or AWT desktop applications.<br />
<a href="http://www.sebastianoliva.com/wp-content/uploads/2010/03/JavaPro.png"><img src="http://www.sebastianoliva.com/wp-content/uploads/2010/03/JavaPro.png" alt="Processing Sketch Running on JFrame " title="JavaPro" width="376" height="357" class="aligncenter size-full wp-image-54" /></a><br />
<span id="more-71"></span><br />
I am assuming you have a basic notion of Object Oriented Programming, and preferably a base on Java, as it is obvious, you will need basic Processing skills.<br />
The first Step is to download Processing, I will not go too deep onto this, but just make sure you get the latest version for your OS.<br />
You will also need the Java Development Kit (JDK) and preferably an IDE (Integrated Development Environment) to help you along the way, two popular ones are <a href="http://www.netbeans.org/">NetBeans</a> and <a href="http://www.eclipse.org">Eclipse</a>.</p>
<p>After your environment is all set up, you will need a to create a new Project, just follow the instructions for your IDE.</p>
<p>The second step is to add to your project the library <code>core.jar</code>, which contains the basic Processing functionality. This library is found on the lib/ folder of the main Processing folder. For Linux this is located wherever you installed Processing, on Windows it is on Program Files/Processing, and in Mac it is located inside Processing.app, just Select the app, select File Menu > Show Package Contents and then open Resources folder.</p>
<p>Once you&#8217;ve added the library to your project, it&#8217;s real easy to start using it. PApplet is the class which Processing Applets extend, and it holds 2 very important methods, which you must implement to make a working Processing Sketch, this ones are <code>void setup()</code> and <code>void draw()</code>.<br />
You might note that this ones are quite similar to the ones on an average interactive Processing sketch, and you are totally right, in fact this ones are the exact equivalent as Processing converts your code to pure Java.</p>
<p>A basic and important thing to keep in mind is that PApplet extends from <code>java.awt.Component</code> so to your AWT of Swing based app, it will be no different from any other component, and it will be as easy to add to your JFrame or JPanel.</p>
<p>Let&#8217;s begin with a simple example</p>
<h3>Simple Processing</h3>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    size<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">400</span>, <span style="color: #cc66cc;">400</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    background<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> draw<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    background<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    fill<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    ellipseMode<span style="color: #009900;">&#40;</span>CENTER<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    ellipse<span style="color: #009900;">&#40;</span>mouseX,mouseY,<span style="color: #cc66cc;">40</span>,<span style="color: #cc66cc;">40</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span></pre></div></div>

<p>Now to add it to our application, we must create a class that extends PApplet, a JFrame to contain it and a Main class to launch it, your app then should look similar to this:</p>
<h3>Java Source Code</h3>
<h4>Main.java</h4>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">processJava</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Main <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">new</span> DisplayFrame<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">setVisible</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h4>DisplayFrame.java</h4>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">processJava</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> DisplayFrame <span style="color: #000000; font-weight: bold;">extends</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JFrame</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> DisplayFrame<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">setSize</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">600</span>, <span style="color: #cc66cc;">600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//The window Dimensions</span>
        setDefaultCloseOperation<span style="color: #009900;">&#40;</span>javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">WindowConstants</span>.<span style="color: #006633;">EXIT_ON_CLOSE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JPanel</span> panel <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JPanel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        panel.<span style="color: #006633;">setBounds</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">20</span>, <span style="color: #cc66cc;">20</span>, <span style="color: #cc66cc;">600</span>, <span style="color: #cc66cc;">600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        processing.<span style="color: #006633;">core</span>.<span style="color: #006633;">PApplet</span> sketch <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SketchCirculo<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        panel.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>sketch<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>panel<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        sketch.<span style="color: #006633;">init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//this is the function used to start the execution of the sketch</span>
        <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">setVisible</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h4>CircleSketch.java</h4>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">processJava</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">processing.core.*</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> CircleSketch <span style="color: #000000; font-weight: bold;">extends</span> PApplet <span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    size<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">400</span>, <span style="color: #cc66cc;">400</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    background<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> draw<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    background<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    fill<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    ellipseMode<span style="color: #009900;">&#40;</span>CENTER<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    ellipse<span style="color: #009900;">&#40;</span>mouseX,mouseY,<span style="color: #cc66cc;">40</span>,<span style="color: #cc66cc;">40</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>It&#8217;s done, now just press run and enjoy.<br />
You now have no excuse to keep your processing sketches apart from your desktop applications </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastianoliva.com/en/2010/05/using-a-processing-sketch-as-a-java-component/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Last.fm API visualizations</title>
		<link>http://www.sebastianoliva.com/en/2010/04/last-fm-api-visualizations/</link>
		<comments>http://www.sebastianoliva.com/en/2010/04/last-fm-api-visualizations/#comments</comments>
		<pubDate>Sat, 01 May 2010 06:35:30 +0000</pubDate>
		<dc:creator>tian</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Geek Stuff]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[nodebox]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[shoebot]]></category>

		<guid isPermaLink="false">http://www.sebastianoliva.com/?p=62</guid>
		<description><![CDATA[A small experiment with Nodebox/Shoebot, and as an excuse to use the Last.fm API, beat.py is a visualisation of related artists, provided by data from Last.fm It features a simple use of several simple commands for Nodebox and as a small demo for pylast The code is available on github at http://github.com/tian2992/botboxvis]]></description>
			<content:encoded><![CDATA[<p>A small experiment with <a href="http://nodebox.net/">Nodebox</a>/<a href="http://shoebot.net/">Shoebot</a>, and as an excuse to use the <a href="http://www.last.fm/api">Last.fm API</a>, beat.py is a visualisation of related artists, provided by data from Last.fm </p>
<p><a href="http://www.sebastianoliva.com/wp-content/uploads/2010/04/beat2.png"><img src="http://www.sebastianoliva.com/wp-content/uploads/2010/04/beat2.png" alt="" title="BeatlesRainbow" width="50%" class="aligncenter size-medium wp-image-63" /></a></p>
<p>It features a simple use of several simple commands for Nodebox and as a small demo for <a href="http://code.google.com/p/pylast/">pylast</a><br />
The code is available on github at <a href="http://github.com/tian2992/botboxvis">http://github.com/tian2992/botboxvis</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastianoliva.com/en/2010/04/last-fm-api-visualizations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gotta Love Nodebox</title>
		<link>http://www.sebastianoliva.com/en/2010/01/gotta-love-nodebox/</link>
		<comments>http://www.sebastianoliva.com/en/2010/01/gotta-love-nodebox/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 06:56:54 +0000</pubDate>
		<dc:creator>tian</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Geek Stuff]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[nodebox]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.sebastianoliva.com/?p=41</guid>
		<description><![CDATA[I really like Nodebox. The idea of mixing the Ease of use and Power of Python with the Rendering of Quartz, is simply great. One of my favourite things about it is the great quality of the rendering; it&#8217;s just gorgeous. Within a few hours, I went back to the level I had a few [...]]]></description>
			<content:encoded><![CDATA[<p>I really like Nodebox. The idea of mixing the Ease of use and Power of Python with the Rendering of Quartz, is simply great. One of my favourite things about it is the great quality of the rendering; it&#8217;s just gorgeous.<br />
<span id="more-41"></span><br />
<a href="http://www.sebastianoliva.com/wp-content/uploads/2010/01/beatles.png"><img src="http://www.sebastianoliva.com/wp-content/uploads/2010/01/beatles.png" alt="Beatles Similar Artists Graph" title="beatles" width="500" height="500" class="alignnone size-full wp-image-43" /></a></p>
<p>Within a few hours, I went back to the level I had a few years ago, when I started with Nodebox.<br />
One of the greatest things about it is the Excellent Typographic support, courtesy AAT and Quartz.</p>
<p><a href="http://www.sebastianoliva.com/wp-content/uploads/2010/01/blagamond.png"><img src="http://www.sebastianoliva.com/wp-content/uploads/2010/01/blagamond.png" alt="Garamond" title="GaramondPro" width="500" height="375" class="alignnone size-full wp-image-46" /></a></p>
<p>The only grip I used to have against it was the limit on libraries, as Nodebox restricts the Python environment, but after a few hours, I got a very simple solution:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>NodeBox<span style="color: #000000; font-weight: bold;">/</span>NodeBox.app<span style="color: #000000; font-weight: bold;">/</span>Contents<span style="color: #000000; font-weight: bold;">/</span>Resources<span style="color: #000000; font-weight: bold;">/</span>Python
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Python<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2.5</span><span style="color: #000000; font-weight: bold;">/</span>site-packages <span style="color: #000000; font-weight: bold;">/</span>Applications<span style="color: #000000; font-weight: bold;">/</span>NodeBox<span style="color: #000000; font-weight: bold;">/</span>NodeBox.app<span style="color: #000000; font-weight: bold;">/</span>Contents<span style="color: #000000; font-weight: bold;">/</span>Resources<span style="color: #000000; font-weight: bold;">/</span>Python</pre></div></div>

<p>After this, all the import statements worked as a charm, so now it&#8217;s time to make use of it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastianoliva.com/en/2010/01/gotta-love-nodebox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iTunesXSPF</title>
		<link>http://www.sebastianoliva.com/en/2010/01/itunesxspf-2/</link>
		<comments>http://www.sebastianoliva.com/en/2010/01/itunesxspf-2/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 01:47:19 +0000</pubDate>
		<dc:creator>tian</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Geek Stuff]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[iTunes]]></category>
		<category><![CDATA[iTunesXSPF]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xslt]]></category>
		<category><![CDATA[xspf]]></category>

		<guid isPermaLink="false">http://www.sebastianoliva.com/?p=37</guid>
		<description><![CDATA[Several days ago, a cousin asked me for a playlist. I thought of several forms for me to share it with her, until I found XSPF (http://xspf.org/), a perfect solution for my requirements, with a ton of available applications. However, there was a problem, my whole Music Collection is in iTunes. Gladly, I made the [...]]]></description>
			<content:encoded><![CDATA[<p>Several days ago, a cousin asked me for a playlist. I thought of several forms for me to share it with her, until I found <a href="http://xspf.org/">XSPF (http://xspf.org/)</a>, a perfect solution for my requirements, with a ton of available <a href="http://xspf.org/applications/">applications</a>. However, there was a problem, my whole Music Collection is in iTunes.<br />
<span id="more-37"></span></p>
<p>Gladly, I made the playlist, without taking into account the lack of converters available. After I finished it, it hit me; so I dedicated a few hours into making iTunesXSPF, an XSLT converter between iTunes&#8217; XML playlist format to XSPF.</p>
<p>To use it, just export your playlist to XML on iTunes, then download (and unzip) the file on the same folder, and modify the first lines to:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml-stylesheet</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/xsl&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;itunes.xsl&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
 <span style="color: #00bbdd;">&lt;!DOCTYPE plist PUBLIC &quot;-//Apple Computer//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;</span></pre></div></div>

<p>Also you can use xsltproc if you have it available:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">xsltproc playlist.xml itunes.xsl lista.xspf</pre></div></div>

<p>Full code and Download:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #808080; font-style: italic;">&lt;!-- iTunesXSPF, by Sebastian Oliva (tian@sebastianoliva.com) [http://sebastianoliva.com]</span>
<span style="color: #808080; font-style: italic;">Copyright (C) 2009,2010 Sebastian Oliva</span>
&nbsp;
<span style="color: #808080; font-style: italic;">This program is free software: you can redistribute it and/or modify</span>
<span style="color: #808080; font-style: italic;">it under the terms of the GNU Affero General Public License as</span>
<span style="color: #808080; font-style: italic;">published by the Free Software Foundation, either version 3 of the</span>
<span style="color: #808080; font-style: italic;">License, or (at your option) any later version.</span>
&nbsp;
<span style="color: #808080; font-style: italic;">This program is distributed in the hope that it will be useful,</span>
<span style="color: #808080; font-style: italic;">but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span style="color: #808080; font-style: italic;">MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<span style="color: #808080; font-style: italic;">GNU Affero General Public License for more details.</span>
&nbsp;
<span style="color: #808080; font-style: italic;">You should have received a copy of the GNU Affero General Public License</span>
<span style="color: #808080; font-style: italic;">along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<span style="color: #808080; font-style: italic;">--&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:stylesheet</span> <span style="color: #000066;">xmlns:xsl</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/1999/XSL/Transform&quot;</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:output</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;xml&quot;</span> <span style="color: #000066;">indent</span>=<span style="color: #ff0000;">&quot;yes&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:template</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;playlist</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://xspf.org/ns/0/&quot;</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		  <span style="color: #808080; font-style: italic;">&lt;!-- Add your Own Info Here --&gt;</span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Playlist<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;creator<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Me<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/creator<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;info<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://example.com/<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/info<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #808080; font-style: italic;">&lt;!-- Editing Further is unsafe --&gt;</span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;trackList<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:for-each</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;plist/dict/array/dict/array/dict&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:variable</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Traki&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;xsl:apply-templates</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;key[. = 'Track ID']&quot;</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;content&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/xsl:variable<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:for-each</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;/plist/dict/dict/dict&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:if</span> <span style="color: #000066;">test</span>=<span style="color: #ff0000;">&quot;key[. = 'Track ID']/following-sibling::*/text() = $Traki&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
							<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;track<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
								<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;xsl:apply-templates</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;key[. = 'Name']&quot;</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;content&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
								<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;creator<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;xsl:apply-templates</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;key[. = 'Artist']&quot;</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;content&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/creator<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
								<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;album<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;xsl:apply-templates</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;key[. = 'Album']&quot;</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;content&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/album<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
								<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;location<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;xsl:apply-templates</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;key[. = 'Location']&quot;</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;content&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/location<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
								<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;annotation<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;xsl:apply-templates</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;key[. = 'Comments']&quot;</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;content&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/annotation<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
								<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;duration<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;xsl:apply-templates</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;key[. = 'Total Time']&quot;</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;content&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/duration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
							<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/track<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:if<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:for-each<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:for-each<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/trackList<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/playlist<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:template</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;key&quot;</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;content&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:value-of</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;following-sibling::*/text()&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:template</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;trim&quot;</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;content&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:value-of</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;following-sibling::*/text()&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:stylesheet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Download: <a href='http://www.sebastianoliva.com/wp-content/uploads/2010/01/itunes.xsl_.zip'>itunes.xsl (zipped)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastianoliva.com/en/2010/01/itunesxspf-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello World!</title>
		<link>http://www.sebastianoliva.com/en/2010/01/hello-world-2/</link>
		<comments>http://www.sebastianoliva.com/en/2010/01/hello-world-2/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 05:47:47 +0000</pubDate>
		<dc:creator>tian</dc:creator>
				<category><![CDATA[Uncategorized @en]]></category>

		<guid isPermaLink="false">http://www.sebastianoliva.com/?p=21</guid>
		<description><![CDATA[Hi!, so you are now on my new and nifty blog, well, I do not have much to say, but I will (that&#8217;s the reason of this after all…), so I hope to see you back again, soon.]]></description>
			<content:encoded><![CDATA[<p>Hi!, so you are now on my new and nifty blog, well, I do not have much to say, but I will (that&#8217;s the reason of this after all…), so I hope to see you back again, soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sebastianoliva.com/en/2010/01/hello-world-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
