<?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>Tony Virelli - Web Developer - HTML, xHTML, PHP, MySQL, JavaScript&#187; Perl</title>
	<atom:link href="http://tonyvirelli.com/category/blog/perl-blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://tonyvirelli.com</link>
	<description>Tony Virelli - I share the information I have dealing with web design, technology, the internet and more</description>
	<lastBuildDate>Tue, 31 Jan 2012 14:57:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Make 007 Jealous With RSA Encryption</title>
		<link>http://tonyvirelli.com/slider/make-007-jealous-with-rsa-encryption/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=make-007-jealous-with-rsa-encryption</link>
		<comments>http://tonyvirelli.com/slider/make-007-jealous-with-rsa-encryption/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 22:50:17 +0000</pubDate>
		<dc:creator>John Hass</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[Encryption]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[RSA]]></category>

		<guid isPermaLink="false">http://tonyvirelli.com/?p=558</guid>
		<description><![CDATA[Make 007 Jealous Public/Private encryption is not a new thing, did you know you can use my favorite swiss army knife to send secret messages to your friends…. Scratch that, I don&#8217;t have any friends… Perl Makes this easy with a little module calls Crypt::RSA, yes RSA is under fire for security blah blah, I [...]]]></description>
			<content:encoded><![CDATA[<p>Make 007 Jealous</p>
<p>Public/Private encryption is not a new thing, did you know you can use my favorite swiss army knife to send secret messages to your friends…. Scratch that, I don&#8217;t have any friends…  Perl Makes this easy with a little module calls Crypt::RSA, yes RSA is under fire for security blah blah, I don&#8217;t care, it&#8217;s still secure, because Mr. S&#8217;s (yes it&#8217;s a dudes name) I can&#8217;t pronounce nor spell, I know it will be fairly decent, I am almost about sure Mr. S should be Dr. S, but that just sounds evil, so without further ado, public/private key encryption with perl.<br />
<span id="more-558"></span><br />
Two people in this Article Tony and John, John wants all correspondence encrypted Tony Encrypts.</p>
<p>I am on my new Mac now, so your mileage may very….</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-MCPAN</span> <span style="color: #660033;">-e</span> shell
<span style="color: #c20cb9; font-weight: bold;">install</span> Crypt::RSA</pre></div></div>

<p>it asks you about a ton of dependencies, don&#8217;t do what your high school guidance counselor told you and just say yes.</p>
<p>Create something to make the keys</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
<span style="color: #000000; font-weight: bold;">use</span> Crypt<span style="color: #339933;">::</span><span style="color: #006600;">RSA</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$rsa</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Crypt<span style="color: #339933;">::</span><span style="color: #006600;">RSA</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">eq</span> <span style="color: #ff0000;">&quot;--makekeys&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$public</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$private</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$rsa</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">keygen</span><span style="color: #009900;">&#40;</span> 
				Size <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">2048</span><span style="color: #339933;">,</span>
				Filename <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">&quot;keylock&quot;</span><span style="color: #339933;">,</span>
				<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">exit</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The start of out program generate our rsa key, keylock.private (and keep this private, no touchy no sendy) and keylock.private, send this to everyone</p>
<p>ok send the public key to tony, so he can send us a message….  Tony should create the message now</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">eq</span> <span style="color: #ff0000;">&quot;--createmessage&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #0000ff;">$key</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$message</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">#open the key</span>
	<span style="color: #0000ff;">$akey</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Crypt<span style="color: #339933;">::</span><span style="color: #006600;">RSA</span><span style="color: #339933;">::</span><span style="color: #006600;">Key</span><span style="color: #339933;">::</span><span style="color: #006600;">Public</span> <span style="color: #009900;">&#40;</span>	Filename <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">&quot;$key&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$output</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$rsa</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">encrypt</span><span style="color: #009900;">&#40;</span>Message <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">$message</span><span style="color: #339933;">,</span>Key<span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">$akey</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">||</span> <span style="color: #000066;">die</span> <span style="color: #0000ff;">$rsa</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">errstr</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">open</span> ENC<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;&gt;message&quot;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #0000ff;">$!</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">binmode</span> ENC<span style="color: #339933;">;</span>
	<span style="color: #000066;">print</span> ENC <span style="color: #0000ff;">$output</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">exit</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>One thing that was a gotcha for me was writing the file, I forgot to tell perl to write it binary, since the encryption is all binary, we must write it so.  We now have a file called &#8220;message&#8221; if you try to edit the file, it&#8217;s all gobble gook.  Tony can now send you this message, and only you can read it, but how?</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">eq</span> <span style="color: #ff0000;">&quot;--readmessage&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #0000ff;">$key</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$message</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066;">open</span> FILE<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;$message&quot;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #0000ff;">$!</span><span style="color: #339933;">;</span> 
	<span style="color: #000066;">binmode</span> FILE<span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$buf</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$data</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$n</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$n</span> <span style="color: #339933;">=</span> <span style="color: #000066;">read</span> FILE<span style="color: #339933;">,</span> <span style="color: #0000ff;">$data</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #0000ff;">$buf</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">$data</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> 
	<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span>FILE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
	<span style="color: #0000ff;">$akey</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Crypt<span style="color: #339933;">::</span><span style="color: #006600;">RSA</span><span style="color: #339933;">::</span><span style="color: #006600;">Key</span><span style="color: #339933;">::</span><span style="color: #006600;">Private</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">read</span><span style="color: #009900;">&#40;</span>Filename <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">&quot;$key&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$output</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$rsa</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">decrypt</span><span style="color: #009900;">&#40;</span>Cyphertext <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">&quot;$buf&quot;</span><span style="color: #339933;">,</span>Key <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">$akey</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">||</span> <span style="color: #000066;">die</span> <span style="color: #0000ff;">$rsa</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">errstr</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">print</span> <span style="color: #0000ff;">$output</span> <span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066;">exit</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>So now we read the file &#8220;message&#8221; in using our private key, since Tony encrypted the message with our public key, we can now read it with the private key….  So how does this work?</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">John-Hasss-Mac-Pro:~ john$ .<span style="color: #000000; font-weight: bold;">/</span>keylock.pl <span style="color: #660033;">--makekeys</span>
John-Hasss-Mac-Pro:~ john$ .<span style="color: #000000; font-weight: bold;">/</span>keylock.pl <span style="color: #660033;">--createmessage</span> keylock.public <span style="color: #ff0000;">&quot;007 would be so jealous&quot;</span>
John-Hasss-Mac-Pro:~ john$ <span style="color: #c20cb9; font-weight: bold;">cat</span> message 
?????u?????מ?n???-<span style="color: #000000; font-weight: bold;">@</span>?l?Q??<span style="color: #7a0874; font-weight: bold;">&#41;</span>??~<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000;">3</span>?<span style="color: #ff0000;">&quot;h2??=,??3??݁/m?s?[?M)?F?}?|ߩJ????k;?7??i???D?\w;?U??ʬ??y7ǳ??&amp;?]pXv?-???E@&quot;</span>X?E?HH0?<span style="color: #7a0874; font-weight: bold;">&#40;</span>S?<span style="color: #ff0000;">&quot;?`?,?R??7???ϳ
  ??Ցh???촇??K??Rs??uxs;??r^΀?G?????5??W??Y???4Y??_~?(YͷӍr\űeĥr??John-Hasss-Mac-Pro:~ john$ 
John-Hasss-Mac-Pro:~ john$ 
John-Hasss-Mac-Pro:~ john$ ./keylock.pl --readmessage keylock.private message
007 would be so jealous
John-Hasss-Mac-Pro:~ john$</span></pre></div></div>

<p>Welcome to the magic of public private key encryption!</p>
<p>Have fun!</p>
<a class="downloadlink" href="http://tonyvirelli.com/downloads/keylock.zip" title=" downloaded 34 times" >keylock.zip (34)</a>
]]></content:encoded>
			<wfw:commentRss>http://tonyvirelli.com/slider/make-007-jealous-with-rsa-encryption/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Clearing Out Postfix Deferred Mail Queue</title>
		<link>http://tonyvirelli.com/slider/clearing-out-postfix-deferred-mail-queue/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=clearing-out-postfix-deferred-mail-queue</link>
		<comments>http://tonyvirelli.com/slider/clearing-out-postfix-deferred-mail-queue/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 17:06:16 +0000</pubDate>
		<dc:creator>Tony Virelli</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[mail queue]]></category>
		<category><![CDATA[mailq]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[postfix]]></category>

		<guid isPermaLink="false">http://tonyvirelli.com/?p=550</guid>
		<description><![CDATA[I had a bit of a situation with my Postfix Mail Queue. Mail stopped sending and the queue built up. When I did a mailq I found a lot of double-bounce@domain.com emails in my queue. I knew it would take forever for those to clear and get the good mail flowing again. So after doing [...]]]></description>
			<content:encoded><![CDATA[<p>I had a bit of a situation with my Postfix Mail Queue. Mail stopped sending and the queue built up. When I did a mailq I found a lot of double-bounce@domain.com emails in my queue. I knew it would take forever for those to clear and get the good mail flowing again.<br />
<span id="more-550"></span><br />
So after doing some searching on Google I found this site:<br />
<a href="http://www.cyberciti.biz/tips/howto-postfix-flush-mail-queue.html">http://www.cyberciti.biz/tips/howto-postfix-flush-mail-queue.html</a></p>
<p>It has some of the common Postfix commands, but what interested me was the Perl script to delete mailqs that matched regular expressions.</p>
<p><strong>postfix-delete.pl script</strong></p>
<p>The following script deletes all mail from the mailq which matches the regular expression specified as the first argument.</p>
<p><em>(Credit: Vivek Gite of cyberciti.biz.  His credit: Credit: ??? &#8211; I found it on old good newsgroup)</em></p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
&nbsp;
<span style="color: #0000ff;">$REGEXP</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span> <span style="color: #339933;">||</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;no email-adress given (regexp-style, e.g. bl.*<span style="color: #000099; font-weight: bold;">\@</span>yahoo.com)!&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">@data</span> <span style="color: #339933;">=</span> <span style="color: #000066;">qx</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">@data</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/^(\w+)(\*|\!)?\s/</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #0000ff;">$queue_id</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$1</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$queue_id</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/$REGEXP/i</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #0000ff;">$Q</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$queue_id</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
      <span style="color: #0000ff;">$queue_id</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#open(POSTSUPER,&quot;|cat&quot;) || die &quot;couldn't open postsuper&quot; ;</span>
<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>POSTSUPER<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;|postsuper -d -&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;couldn't open postsuper&quot;</span> <span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">keys</span> <span style="color: #0000ff;">%Q</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000066;">print</span> POSTSUPER <span style="color: #ff0000;">&quot;$_<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span>POSTSUPER<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>For example, delete all queued messages from or to the domain called double-bounce@domain.com, enter:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>postfix-delete.pl double-bounce<span style="color: #000000; font-weight: bold;">@</span>domain.com</pre></div></div>

<p>Delete all queued messages that contain the word &#8220;xyz&#8221; in the e-mail address:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>postfix-delete.pl xyz</pre></div></div>

<p>For more information about this script make sure and checkout <a href="http://www.cyberciti.biz/tips/howto-postfix-flush-mail-queue.html">http://www.cyberciti.biz/tips/howto-postfix-flush-mail-queue.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tonyvirelli.com/slider/clearing-out-postfix-deferred-mail-queue/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting Your Clock From Google</title>
		<link>http://tonyvirelli.com/slider/setting-your-clock-from-google/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=setting-your-clock-from-google</link>
		<comments>http://tonyvirelli.com/slider/setting-your-clock-from-google/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 14:30:40 +0000</pubDate>
		<dc:creator>John Hass</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ntp]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[sockets]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[useless]]></category>

		<guid isPermaLink="false">http://tonyvirelli.com/?p=257</guid>
		<description><![CDATA[It&#8217;s time for another episode of, why the hell would you want to do that, I am your host John Hass.  On Today&#8217;s show we are going to teach you how to set the time from Google&#8217;s web server. So the first question is why, my answer is why not.  The web is full of [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s time for another episode of, why the hell would you want to do that, I am your host John Hass.  On Today&#8217;s show we are going to teach you how to set the time from Google&#8217;s web server.</p>
<p>So the first question is why, my answer is why not.  The web is full of useless things, lets add one more.  Once again using Linux and Perl, you must be root to set the time.<br />
<span id="more-257"></span></p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
<span style="color: #000000; font-weight: bold;">use</span> IO<span style="color: #339933;">::</span><span style="color: #006600;">Socket</span><span style="color: #339933;">;</span></pre></div></div>

<p>IO::Socket is the only required library for this endeavor.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #0000ff;">$host</span><span style="color: #339933;">=</span><span style="color: #000066;">shift</span> <span style="color: #339933;">||</span> <span style="color: #ff0000;">'www.google.com'</span><span style="color: #339933;">;</span></pre></div></div>

<p>Google does not have to be where you get your time, so you can call the program with your favorite web host, but I figure you go to them for everything else why not go to them for the time.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$sock</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> IO<span style="color: #339933;">::</span><span style="color: #006600;">Socket</span><span style="color: #339933;">::</span><span style="color: #006600;">INET</span> <span style="color: #009900;">&#40;</span>
PeerAddr <span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$host</span><span style="color: #339933;">,</span>
PeerPort <span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #ff0000;">'80'</span><span style="color: #339933;">,</span>
Proto <span style="color: #339933;">=</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #ff0000;">'tcp'</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Could not create connection to $host $!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #b1b100;">unless</span> <span style="color: #0000ff;">$sock</span><span style="color: #339933;">;</span></pre></div></div>

<p>Create the socket connection to Google, we only support http so I just forced the port to 80.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #000066;">print</span> <span style="color: #0000ff;">$sock</span> <span style="color: #ff0000;">&quot;HEAD / HTTP/1.1<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$ok</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$loop</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$date</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Give Google the Head command to ask for some juicy info.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000066;">chomp</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$_</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">#print $_ . &quot;\n&quot;;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ok</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #0000ff;">&amp;amp</span><span style="color: #339933;">;</span><span style="color: #0000ff;">&amp;amp</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$loop</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Could not get the time<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$sock</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ok</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span> <span style="color: #0000ff;">&amp;amp</span><span style="color: #339933;">;</span><span style="color: #0000ff;">&amp;amp</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$loop</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$_</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">/Date:/</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #0000ff;">$date</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$_</span><span style="color: #339933;">;</span>
<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$sock</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$_</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">/200 OK/</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #0000ff;">$ok</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$loop</span><span style="color: #339933;">++;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$sock</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Parse what your momma gave you, we are looking to make sure the request worked ok and we are making sure that we have a date.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$date</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">/GMT/</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Date and time is in GMT<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;$date<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$date</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/\r//g</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$date</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/Date: //g</span><span style="color: #339933;">;</span>
<span style="color: #ff0000;">`date -s &quot;$date&quot;`</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>lastly we parse out all the junk that we can&#8217;t pass to the Linux date command. then we simply set the date.</p>
<p>Thanks for wasting your time with me.</p>
<p>Now go give that network administrator the finger for not letting you specify your own ntp servers!</p>
<p><strong>Source Files: <a class="downloadlink" href="http://tonyvirelli.com/downloads/gettime.zip" title=" downloaded 14 times" >gettime.zip (14)</a><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://tonyvirelli.com/slider/setting-your-clock-from-google/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sweet Google TTS</title>
		<link>http://tonyvirelli.com/slider/sweet-google-tts/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sweet-google-tts</link>
		<comments>http://tonyvirelli.com/slider/sweet-google-tts/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 15:00:27 +0000</pubDate>
		<dc:creator>John Hass</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[Text to Speech]]></category>
		<category><![CDATA[Translate]]></category>

		<guid isPermaLink="false">http://tonyvirelli.com/?p=309</guid>
		<description><![CDATA[Google now has a text to speech service that allows you to type in a URL and some text and it will give you an mp3!  It works fairly well, so I decided to use my Swiss Army knife (Perl) and write a script that will make it easy to get mp3&#8242;s #!/usr/bin/perl use LWP; [...]]]></description>
			<content:encoded><![CDATA[<p>Google now has a text to speech service that allows you to type in a URL and some text and it will give you an mp3!  It works fairly well, so I decided to use my Swiss Army knife (Perl) and write a script that will make it easy to get mp3&#8242;s<br />
<span id="more-309"></span></p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
<span style="color: #000000; font-weight: bold;">use</span> LWP<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$speak</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">length</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$speak</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span><span style="color: #cc66cc;">0</span> <span style="color: #339933;">||</span> <span style="color: #000066;">length</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$speak</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;what you speak needs to be &gt; 0 and &lt;100<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">exit</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>This code will check to make sure that what we want to say follows with google standards. The program is called ./speak.pl &#8220;this is what I want to say&#8221;</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@headers1</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>
<span style="color: #ff0000;">'Host'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'translate.google.com'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'User-Agent'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091109 Ubuntu/9.10 (karmic) Firefox/3.5.5'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'Accept'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'Accept-Language'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'en-us,en;q=0.5'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'Accept-Encoding'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'gzip,deflate'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'Accept-Charset'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'ISO-8859-1,utf-8;q=0.7,*;q=0.7'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'Keep-Alive'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'300'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'Connection'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'keep-alive'</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$browser</span> <span style="color: #339933;">=</span> LWP<span style="color: #339933;">::</span><span style="color: #006600;">UserAgent</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">new</span><span style="color: #339933;">;</span></pre></div></div>

<p>The above is our magic headers. This allows us to use Google and the browser instantiation.</p>
<p>next we need to format it so Google can see it correctly</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #0000ff;">$speak</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/ /+/g</span><span style="color: #339933;">;</span></pre></div></div>

<p>This removes all spaces and makes them +&#8217;s</p>
<p>lastly we connect and download</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #0000ff;">$sec</span> <span style="color: #339933;">=</span> <span style="color: #000066;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$resp</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$browser</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">get</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;http://translate.google.com/translate_tts?q=$speak&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">@headers1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>FILE<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;&gt;$sec.mp3&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> FILE <span style="color: #0000ff;">$resp</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">content</span><span style="color: #339933;">;</span>
<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span>FILE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Wrote $sec.mp3<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>What we do here get the number of seconds for the out filename and write the file.</p>
<p>Have fun and don&#8217;t abuse this service.</p>
<p><strong>Source Files: <a class="downloadlink" href="http://tonyvirelli.com/downloads/tts.zip" title=" downloaded 156 times" >tts.zip (156)</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://tonyvirelli.com/slider/sweet-google-tts/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://translate.google.com/translate_tts?q=" length="0" type="audio/mpeg" />
		</item>
		<item>
		<title>Using Perl To Get Free MP3s!</title>
		<link>http://tonyvirelli.com/slider/using-perl-to-get-free-mp3s/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=using-perl-to-get-free-mp3s</link>
		<comments>http://tonyvirelli.com/slider/using-perl-to-get-free-mp3s/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 07:05:18 +0000</pubDate>
		<dc:creator>John Hass</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[libwww]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[napster]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[swftools]]></category>

		<guid isPermaLink="false">http://tonyvirelli.com/?p=252</guid>
		<description><![CDATA[In this article I am going to code up a program that will actually download music from free.napster.com and give you the 32k mp3 file contained within.  So without further ado, let the Free mp3&#8242;s reign. Using libwww, swftools, and some trickery we can easily download mp3&#8242;s from free.napster.com.  I am using Linux, but all [...]]]></description>
			<content:encoded><![CDATA[<p>In this article I am going to code up a program that will actually download music from <a href="http://free.napster.com">free.napster.com</a> and give you the 32k mp3 file contained within.  So without further ado, let the Free mp3&#8242;s reign.</p>
<p>Using libwww, swftools, and some trickery we can easily download mp3&#8242;s from <a href="http://free.napster.com">free.napster.com</a>.  I am using Linux, but all the requirements for this application should work in Windows.</p>
<p>I am calling my application getTunes.pl for reference. The full source will be attached to this Blog posting.<br />
<span id="more-252"></span><br />
<strong>Create the document</strong></p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
<span style="color: #000000; font-weight: bold;">use</span> LWP<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> Time<span style="color: #339933;">::</span><span style="color: #006600;">HiRes</span> <span style="color: #000066;">qw</span><span style="color: #009900;">&#40;</span>gettimeofday<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> XML<span style="color: #339933;">::</span><span style="color: #006600;">Simple</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> Data<span style="color: #339933;">::</span><span style="color: #006600;">Dumper</span><span style="color: #339933;">;</span></pre></div></div>

<p>The above are the only required Perl libraries, and on my Ubuntu machine all were installed by default.</p>
<p>We have one requirement for a binary swfextract. You can get swftools from: <a href="http://www.swftools.org/">http://www.swftools.org/</a></p>
<p>Our code requires the path to swfextract</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
<span style="color: #000000; font-weight: bold;">use</span> LWP<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> Time<span style="color: #339933;">::</span><span style="color: #006600;">HiRes</span> <span style="color: #000066;">qw</span><span style="color: #009900;">&#40;</span>gettimeofday<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> XML<span style="color: #339933;">::</span><span style="color: #006600;">Simple</span><span style="color: #339933;">;</span>
<span style="color: #339933;">/</span>tuse Data<span style="color: #339933;">::</span><span style="color: #006600;">Dumper</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$swfextract</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;/usr/bin/swfextract&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!-</span>e <span style="color: #0000ff;">$swfextract</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;You must have swftools installed to use this application<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">exit</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The code does a double check to make sure that swfextract is located where you said it was (that is what -e does stands for exists).</p>
<p>We need to create a browser object and an XML object</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #0000ff;">$browser</span> <span style="color: #339933;">=</span> LWP<span style="color: #339933;">::</span><span style="color: #006600;">UserAgent</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">new</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$xml</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> XML<span style="color: #339933;">::</span><span style="color: #006600;">Simple</span><span style="color: #339933;">;</span></pre></div></div>

<p>These will get used later on in the code.</p>
<p>our application is called like ./getTunes.pl song_id so for example. ./getTunes.pl 28908362 will download the Song &#8220;Fireflies by Owl City&#8221;</p>
<p>Our code needs to make sure that the user passes an argument.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #0000ff;">$song_id</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$song_id</span> <span style="color: #b1b100;">eq</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;You must include the sond id to download<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">exit</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Our code includes 2 subroutines the main purpose of them is to generate random information</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">sub</span> random <span style="color: #009900;">&#123;</span>
<span style="color: #0000ff;">$min</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$max</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$random</span> <span style="color: #339933;">=</span> <span style="color: #000066;">rand</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$max</span><span style="color: #339933;">-</span><span style="color: #0000ff;">$min</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #0000ff;">*$random</span><span style="color: #339933;">+</span><span style="color: #0000ff;">$min</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;">sub</span> randomID <span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">#lifted from: http://www.codeproject.com/KB/perl/perl_randomstring.aspx</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$passwordsize</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@alphanumeric</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'a'</span><span style="color: #339933;">..</span><span style="color: #ff0000;">'z'</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'A'</span><span style="color: #339933;">..</span><span style="color: #ff0000;">'Z'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">..</span><span style="color: #cc66cc;">9</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$randpassword</span> <span style="color: #339933;">=</span> <span style="color: #000066;">join</span> <span style="color: #ff0000;">''</span><span style="color: #339933;">,</span> <span style="color: #000066;">map</span> <span style="color: #0000ff;">$alphanumeric</span><span style="color: #009900;">&#91;</span><span style="color: #000066;">rand</span> <span style="color: #0000ff;">@alphanumeric</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">..</span><span style="color: #0000ff;">$passwordsize</span><span style="color: #339933;">;</span>
<span style="color: #000066;">return</span> <span style="color: #0000ff;">$randpassword</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The first one takes two arguments, minimum number and maximum number it then uses Perl&#8217;s built in rand() function to create a decimal number</p>
<p>The second generate a random alpha numeric string.  It was quicker to google this then writing my own, but you get the idea.</p>
<p>In order to download  a song we have to make 3 separate connections to napster in order, or the song won&#8217;t download, each time you connect you must send Napster different headers.</p>
<p>I will outline these connections now.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #0000ff;">$r</span> <span style="color: #339933;">=</span> random<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@headers1</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>
<span style="color: #ff0000;">'User-Agent'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.11'</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$url1</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;http://napsterweb.112.2o7.net/b/ss/napsterweb/1/G.9p2/s68966730169826?[AQB]&amp;ndh=1&amp;t=$Day/$Month/$Year%201%3A9%3A41%204%20300&amp;pageName=Napster%20Web%20-%20Album&amp;g=http%3A//free.napster.com/view/album/index.html%3Fid%3D12601251&amp;r=http%3A//free.napster.com/&amp;ch=Napster%20Web&amp;events=event2&amp;cc=USD&amp;Sc3=Returning%20Anonymous&amp;v3=Play_Track_21470573_http%3A//free.napster.com/view/album/index.html&amp;v4=Returning%20Anonymous&amp;v5=US&amp;s=800x600&amp;c=24&amp;j=1.3&amp;v=Y&amp;k=Y&amp;bw=640x480&amp;bh=$r&amp;p=Shockwave%20Flash%3B&amp;[AQE]&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$resp</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$browser</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$url1</span><span style="color: #339933;">,</span><span style="color: #0000ff;">@headers1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This code may look scary, but there is only a few things needed to make it function correctly, to me this is my way of saying &#8220;Hello Napster I am here&#8221;.<br />
You have to fill in $Day,$month,$year (see full source for that code) $r which is simply a random number.</p>
<p>Then using Perl we pass the query off to napster, and we don&#8217;t care what napster says back, in fact it&#8217;s a picture, a picture of nothing.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #0000ff;">$random_play</span> <span style="color: #339933;">=</span> random<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10000000</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">99999999</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$id</span> <span style="color: #339933;">=</span> randomID<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">43</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$cookie</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;L115=1.1190942847196; SCD=r%3D0%26ch%3DNapster%2520Web%2520Player%26time%3D$time%26FPF%3D0%26ter%3D0%26utype%3D0%26FUID%3D-%26$id%3Dnl; NQ=%3Fquery%3DCooler+Online%26type%3Dartist; s_cc=true; s_sq=%5B%5BB%5D%5D; COUNTRYCODE=US&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@headers2</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>
<span style="color: #ff0000;">'User-Agent'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.11'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'Host'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'free.napster.com'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'Accept'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'Accept-Language'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'en-us,en;q=0.5'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'Accept-Charset'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'UTF-8,*'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'Keep-Alive'</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'30'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'Proxy-Connection'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'keep-alive'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'X-Requested-With'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'XMLHttpRequest'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'X-Prototype-Version'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'1.4.0'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'Referer'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;http://free.napster.com/player/?play_id=$random_play&amp;type=track&quot;</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'Cookie'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$cookie</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$url2</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;http://free.napster.com/playXML/track/$song_id?r=$r&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$resp</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$browser</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$url2</span><span style="color: #339933;">,</span><span style="color: #0000ff;">@headers2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$data</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$xml</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">XMLin</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$resp</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">content</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The second is a query is to get the xml output from Napster with the all important pld, the only thing new here to report is the random_play option on the referrer this is just some more trickery, and the $id which makes use of our alpha numeric string.</p>
<p>you can see above that we loaded the response right into xml. If you were to do a data dump you would see this</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #0000ff;">$VAR1</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
<span style="color: #ff0000;">'clip'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #ff0000;">'track_number'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'9'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'album_name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'Ocean Eyes'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'album_id'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'13291611'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'track_id'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'28908362'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'album_price'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'9.95'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'image_max'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'http://images.napster.com/mp3s/2462/resources/194/471/files/194471299.jpg'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'artist_id'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'12425061'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'pld'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'UmFuZG9tSVZCAI0C.XUUM.tWuyOSGlVb9a8s1hy9sgXORKsWYPpLIwTFi9z6IcXOxX6158hu9Ig.akD1tQXHugZfp15bmWvvZQc.qVhuw8BSql35_Lg6pNB3ZVaRYbi5'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'is_free'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'Y'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'afs'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'Y'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'streaming_is_active'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'Y'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'explicit'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'N'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'track_price'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'1.29'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'artist_name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'Owl City'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'duration'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'03:48'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'display_name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'Fireflies'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'image'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'http://images.napster.com/mp3s/2462/resources/194/471/files/194471301.jpg'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'can_purchase'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'Y'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'genre_id'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'1'</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'content_title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">''</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></div></div>

<p>As you can see there is lots of juicy information in this, I only care about the pld and the display_name</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #0000ff;">$pld</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$data</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>clip<span style="color: #009900;">&#125;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>pld<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$name</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$data</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>clip<span style="color: #009900;">&#125;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>display_name<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The last query is the file download, it is not too scary.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #0000ff;">$cookie2</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;L115=1.1190942847196; SCD=r%3D0%26ch%3DNapster%2520Web%2520Player%26time%3D$time%26FPF%3D0%26ter%3D0%26utype%3D0%26FUID%3D$id-%26uac%3Dnl; NQ=%3Fquery%3DCooler+Online%26type%3Dartist; s_cc=true; s_sq=%5B%5BB%5D%5D; COUNTRYCODE=US; NTLG=UmFuZG9tSVZQv5fLKbtRWco69MsjQmjCc.i8u9_1Z1ThyeJxaqPSfQ--%211&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@headers3</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>
<span style="color: #ff0000;">'User-Agent'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.11'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'Host'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'sms.napster.com'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'Accept'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'Accept-Language'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'en-us,en;q=0.5'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'Accept-Charset'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'UTF-8,*'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'X-Requested-With'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'XMLHttpRequest'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'X-Prototype-Version'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">'1.4.0'</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'Referer'</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;http://free.napster.com/player/?play_id=$random_play&amp;type=track&quot;</span><span style="color: #339933;">,</span>
<span style="color: #ff0000;">'Cookie'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$cookie2</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">#get the file</span>
<span style="color: #0000ff;">$url3</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;http://sms.napster.com/cgi-bin/fetchncomurl.cgi?clip=$pld&amp;suf=.swf&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$resp</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$browser</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$url3</span><span style="color: #339933;">,</span><span style="color: #0000ff;">@headers3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Not too much different then the rest of the queries, but you notice that it looks like I am downloading a swf?</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #0000ff;">$url3</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;http://sms.napster.com/cgi-bin/fetchncomurl.cgi?clip=$pld&amp;suf=.swf&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>That is because I am downloading a swf, so before we get too much into that lets save the file.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #000066;">open</span> <span style="color: #009900;">&#40;</span>SONG<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;&gt;$song_id.swf&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> SONG <span style="color: #0000ff;">$resp</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">content</span><span style="color: #339933;">;</span>
<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span>SONG<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>this will create a file called 28908362.swf we now need to extract the mp3</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #ff0000;">`$swfextract  -m $song_id.swf -o $name.mp3`</span><span style="color: #339933;">;</span>
<span style="color: #000066;">unlink</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;$song_id.swf&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Your mp3 is now created.</p>
<p>So the big question left now is. How do I get song id&#8217;s? Simply go to <a href="http://free.napster.com">free.napster.com</a> click play on the song you want and then in the window get the play_id.</p>
<p><img class="size-full wp-image-255" src="http://tonyvirelli.com/wp-content/uploads/2009/12/napsterplay_id.png" alt="napsterplay_id" width="545" height="123" /></p>
<p>That is it for now!</p>
<p><strong>Source Files: <a class="downloadlink" href="http://tonyvirelli.com/downloads/getTunes.zip" title=" downloaded 19 times" >getTunes.zip (19)</a><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://tonyvirelli.com/slider/using-perl-to-get-free-mp3s/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

