<?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>Webmaster Sucks &#187; php5</title>
	<atom:link href="http://www.webmastersucks.com/tags/php5/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webmastersucks.com</link>
	<description>Here I share stuff I used to suck at as a novice webmaster..</description>
	<lastBuildDate>Tue, 11 May 2010 10:56:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>del.icio.us bookmarks in PHP</title>
		<link>http://www.webmastersucks.com/del-icio-us-bookmarks-in-php/</link>
		<comments>http://www.webmastersucks.com/del-icio-us-bookmarks-in-php/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 08:59:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[del.icio.us]]></category>
		<category><![CDATA[delicious api]]></category>
		<category><![CDATA[delicious bookmark]]></category>
		<category><![CDATA[delicious bookmark php]]></category>
		<category><![CDATA[get delicious bookmark]]></category>
		<category><![CDATA[php5]]></category>

		<guid isPermaLink="false">http://www.webmastersucks.com/?p=239</guid>
		<description><![CDATA[
			
				
			
		
This tutorial uses PHP5 to download and cache your recent bookmarks in RSS format from the Delicious API, then displays them in a HTML unordered list.

&#60;?
function get_delicious()
{
$cache = dirname(__FILE__) . '/caches/delicious';
if(filemtime() &#60; (time() - 300))
{
mkdir(dirname(__FILE__) . '/caches', 0777);
$url = 'https://api.del.icio.us/v1/posts/recent?count=10';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.webmastersucks.com%2Fdel-icio-us-bookmarks-in-php%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.webmastersucks.com%2Fdel-icio-us-bookmarks-in-php%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>This tutorial uses PHP5 to download and cache your recent bookmarks in RSS format from the <a href="http://delicious.com/help/api" target="_blank">Delicious API</a>, then displays them in a HTML unordered list.</p>
<pre class="brush: php;">
&lt;?
function get_delicious()
{
$cache = dirname(__FILE__) . '/caches/delicious';
if(filemtime() &lt; (time() - 300))
{
mkdir(dirname(__FILE__) . '/caches', 0777);
$url = 'https://api.del.icio.us/v1/posts/recent?count=10';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
// add delicious.com username and password below
curl_setopt($ch, CURLOPT_USERPWD, 'username:password');
$data = curl_exec($ch);
curl_close($ch);
$cachefile = fopen($cache, 'wb');
fwrite($cachefile, $data);
fclose($cachefile);
}
else
{
$data = file_get_contents($cache);
}
$xml = simplexml_load_string($data);

$html = '&lt;ul&gt;';
foreach($xml as $item)
{
$html .= '&lt;li&gt;&lt;a href=&quot;' . $item['href'] . '&quot;&gt;' . $item['description'] . '&lt;/a&gt; ' . $item['extended'] . '&lt;/li&gt;';
}
$html .= '&lt;li&gt;&lt;a href=&quot;http://delicious.com/briancray&quot;&gt;More of Brian Cray\'s delicious bookmarks&amp;hellip;&lt;/a&gt;&lt;/li&gt;';
$html .= '&lt;/ul&gt;';
echo $html;
}

// display them
get_delicious();
?&gt;
</pre>
<pre><strong>Source :</strong> <span style="line-height: normal;"><a href="http://briancray.com/2009/delicious-bookmarks-api-php/" target="_blank">http://briancray.com/2009/delicious-bookmarks-api-php/</a>   </span></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.webmastersucks.com/del-icio-us-bookmarks-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
