<?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>samutzCom &#187; PHP</title>
	<atom:link href="http://www.samutz.com/blargh/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.samutz.com/blargh</link>
	<description>Gamer, Web Developer, Skinny White Computer Geek. Blargh.</description>
	<lastBuildDate>Fri, 18 Jun 2010 15:17:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Web Scraping with PHP</title>
		<link>http://www.samutz.com/blargh/2010/04/20/web-scraping-with-php/</link>
		<comments>http://www.samutz.com/blargh/2010/04/20/web-scraping-with-php/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 14:23:14 +0000</pubDate>
		<dc:creator>Samutz</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.samutz.com/blargh/?p=240</guid>
		<description><![CDATA[My brother-in-law wrote a PHP book. And he knows way more about PHP that I do. Go check it out. Despite all the advancements in web APIs and interoperability, it’s inevitable that, at some point in your career, you will have to “scrape” content from a website that was not built with web services in [...]]]></description>
			<content:encoded><![CDATA[<p><a style="float: right; padding:15px;" href="http://www.phparch.com/books/phparchitects-guide-to-web-scraping-with-php/"><img src="http://www.phparch.com/wp-content/themes/phpa/thumb.php?src=http://www.phparch.com/blogs.dir/3/files/2010/04/9780981034508.jpg&amp;w=200" alt="" /></a>My brother-in-law wrote a PHP <a href="http://www.phparch.com/books/phparchitects-guide-to-web-scraping-with-php/">book</a>. And he knows way more about PHP that I do.<br />
Go check it out.</p>
<p><em><span style="color: #808080;">Despite all the advancements in web APIs and interoperability, it’s inevitable that, at some point in your career, you will have to “scrape” content from a website that was not built with web services in mind. And, despite its sometimes less-than-stellar reputation, web scraping is usually an entire legitimate activity—for example, to capture data from an old version of a website for insertion into a modern CMS.</span></em></p>
<p><em><span style="color: #808080;">This book, written by scraping expert Matthew Turland, covers web scraping techniques and topics that range from the simple to exotic using a variety of technologies and frameworks:</span></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.samutz.com/blargh/2010/04/20/web-scraping-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parsing a Playlist.com playlist with PHP</title>
		<link>http://www.samutz.com/blargh/2009/12/08/parsing-a-playlist-com-playlist-with-php/</link>
		<comments>http://www.samutz.com/blargh/2009/12/08/parsing-a-playlist-com-playlist-with-php/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 20:43:16 +0000</pubDate>
		<dc:creator>Samutz</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.samutz.com/blargh/?p=224</guid>
		<description><![CDATA[burningwriter needed a quick way to download all the songs in a Playlist.com playlist (formerly called Project Playlist), so I wrote this quick script to parse the playlist files as links that DownThemAll can read. To use it, download a playlist from Playlist.com. You do this by clicking the &#8220;Export Playlist To Windows Media Player&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://fortheloss.samutz.com/" target="_blank">burningwriter</a> needed a quick way to download all the songs in a <a href="http://www.playlist.com/" target="_blank">Playlist.com</a> playlist (formerly called Project Playlist), so I wrote this quick script to parse the playlist files as links that <a href="http://www.downthemall.net/" target="_blank">DownThemAll</a> can read.</p>
<p>To use it, download a playlist from Playlist.com.<br />
You do this by clicking the &#8220;Export Playlist To Windows Media Player&#8221; link on the right side of the site. If it doesn&#8217;t prompt you to download a file, right click the link and select Save As.</p>
<p>Then upload the asx.wvx file here: <a href="http://www.samutz.com/playlist/">samutz.com/playlist</a><br />
The script will generate links from the playlist. You can then download them individually or use something like DownThemAll to get them all at once.</p>
<p>Source and more technical info after the jump.</p>
<p><span id="more-224"></span></p>
<p>Asx.wvx is basically just an xml file that Windows Media Player can read to play the songs in the playlist.</p>
<p>You can load it in to PHP with SimpleXML.</p>
<p>Here&#8217;s the source code for the page I made at <a href="http://www.samutz.com/playlist/">samutz.com/playlist</a></p>
<pre class="brush: php;">
&lt;form action=&quot;index.php&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;MAX_FILE_SIZE&quot; value=&quot;1048576&quot; /&gt;
&lt;input type=&quot;file&quot; name=&quot;file&quot; /&gt;
&lt;input type=&quot;submit&quot; value=&quot;Upload&quot; /&gt;
&lt;/form&gt;

&lt;?php
if (isset($_FILES['file']) &amp;&amp; $_FILES['file']['error']==0) {
	$xml = simplexml_load_file($_FILES['file']['tmp_name']);
	foreach ($xml-&gt;entry as $entry) {
		$attr = $entry-&gt;ref-&gt;attributes();
		echo '&lt;a href=&quot;'.$attr['href'].'&quot;&gt;'.$entry-&gt;title.' by '.$entry-&gt;author.'&lt;/a&gt;&lt;br/&gt;';
	}
} else {
	echo 'Upload asx.wvx above.';
}
?&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.samutz.com/blargh/2009/12/08/parsing-a-playlist-com-playlist-with-php/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
