<?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>phoenixheart - portfolio &#38; more &#187; api</title>
	<atom:link href="http://www.phoenixheart.net/tag/api/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phoenixheart.net</link>
	<description>phoenixheart - portfolio &#38; more</description>
	<lastBuildDate>Wed, 23 Mar 2011 09:47:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
	<script type="text/javascript">
if (typeof Meebo == "undefined") {
Meebo=function(){(Meebo._=Meebo._||[]).push(arguments)};
(function(q){

	var args = arguments;
	if (!document.body) { return setTimeout(function(){ args.callee.apply(this, args) }, 100); }
	var d=document, b=d.body, m=b.insertBefore(d.createElement('div'), b.firstChild); s=d.createElement('script');
	m.id='meebo'; m.style.display='none'; m.innerHTML='<iframe id="meebo-iframe"></iframe>';
	s.src='http'+(q.https?'s':'')+'://'+(q.stage?'stage-':'')+'cim.meebo.com/cim/cim.php?network='+q.network;
	b.insertBefore(s, b.firstChild);

})({network:'phoenixheartnet_bo16we'});	}</script>	<item>
		<title>FilesTube API</title>
		<link>http://www.phoenixheart.net/2008/10/filestube-api/</link>
		<comments>http://www.phoenixheart.net/2008/10/filestube-api/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 02:55:20 +0000</pubDate>
		<dc:creator>An</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Server stuffs]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[freelance]]></category>

		<guid isPermaLink="false">http://www.phoenixheart.net/?p=28</guid>
		<description><![CDATA[Yesterday I received this small project to fix a Rapidshare searcher script. They were using an X-request from their server to FilesTube search form, then got the HTML result in a string and explode()&#8216;ed it. Yes, you can tell it was once working like a charm, but not stable at all, since just one small [...]]]></description>
			<content:encoded><![CDATA[<p><span class="drop-cap">Y</span>esterday I received this small project to fix a <a href="http://rapidshare.de">Rapidshare</a> searcher script. They were using an X-request from their server to <a href="http://www.filestube.com/">FilesTube</a> search form, then got the HTML result in a string and <a href="http://www.php.net/explode">explode()</a>&#8216;ed it. Yes, you can tell it was once working like a charm, but not stable at all, since just one small change in FilesTube&#8217;s layout can break the code. And it did, really.</p>
<p>Lucky me (and my client), when changing the layout, the nice guys at FilesTube built an API also, as thoroughly technically described <a href="http://www.filestube.com/apidoc.html">here</a>. There&#8217;s an example too, and although it looks like a bunch of unmaintained code, it works out of the box. Actually, it does if your server meets these requirements (which I couldn&#8217;t find anywhere on FilesTube&#8217;s website):</p>
<ul>
<li>It runs PHP 5, which is now the standard PHP version. I believe however, that you can use PHP 4 to achieve the exact result.</li>
<li>It has <a href="http://www.php.net/curl">cURL</a> enabled. This is, again, not a problem, since almost every hosting provider has it by default. Yours doesn&#8217;t? Well, it&#8217;s time to move dude. Being a conservative? You may try <a href="http://www.php.net/file_get_contents">file_get_contents()</a> instead.</li>
</ul>
<p><span id="more-28"></span><br />
The way it works is, just send a search phrase along with a uinique (and free!) API key to http://api.filestube.com/ (there are some other options available: related, sort, page, and extension), and receive back an XML string. Something like this:</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
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;answer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;hasResults<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/hasResults<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;results<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;hitsTotal<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>603<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/hitsTotal<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pageNumber<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/pageNumber<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;hitsForThisPage<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>10<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/hitsForThisPage<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;">&lt;<span style="color: #000066;">hitsid</span>=<span style="color: #ff0000;">&quot;11&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>I_am_a_good_daughter_-_Britney.part1.rar<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;extension<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>rar<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/extension<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;size<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>98MB<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/size<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>No description saved<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;address<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://www.filestube.com/91539aa90c9c531d03e9/go.html<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/address<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;details<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://www.filestube.com/91539aa90c9c531d03e9/details.html<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/details<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tags<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>good|daughter|britney<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tags<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rate<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0.00<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rate<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;added<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2007-09-1700:44:16<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/added<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;related<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>14f84a6dab7f39c603e9<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/related<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;password</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/hits<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;">&lt;<span style="color: #000066;">hitsid</span>=<span style="color: #ff0000;">&quot;12&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            ...
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/hits<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            ...
        <span style="color: #009900;">&lt;<span style="color: #000066;">hitsid</span>=<span style="color: #ff0000;">&quot;20&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            ...
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/hits<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/results<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/answer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>As you can see, everything&#8217;s there. Now use a DOMDocument object to parse the XML string. Piece of cake.</p>
<p>The (running well) result can be seen <a href="http://rapidsharese.com/index.php?q=sonata+arctica&amp;fl=&amp;page=1">here</a>. No, I&#8217;m not associated with this website in anyway.</p>
<img style='display:none' id="post-28-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.phoenixheart.net/2008/10/filestube-api/',title:'FilesTube API',tweet:'Yesterday I received this small project to fix a Rapidshare searcher script. They were using an X-re',description:'Yesterday I received this small project to fix a Rapidshare searcher script. They were using an X-re'})"><script type='text/javascript'>document.getElementById("post-28-blankimage").onload();</script>]]></content:encoded>
			<wfw:commentRss>http://www.phoenixheart.net/2008/10/filestube-api/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk (enhanced) (user agent is rejected)
Database Caching 2/10 queries in 0.002 seconds using disk
Object Caching 228/237 objects using disk

Served from: www.phoenixheart.net @ 2012-02-04 02:24:31 -->
