Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
4 lines (4 sloc) 3.21 KB
<code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #007700">require_once&nbsp;</span><span style="color: #0000BB">dirname</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">'/../helper.php'</span><span style="color: #007700">;<br />require_once&nbsp;</span><span style="color: #0000BB">dirname</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">'/../spyc/spyc.php5'</span><span style="color: #007700">;<br />require_once&nbsp;</span><span style="color: #DD0000">'Zend/Service/Delicious.php'</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">//&nbsp;create&nbsp;a&nbsp;new&nbsp;Delicious&nbsp;client&nbsp;instance<br /></span><span style="color: #0000BB">$delicious&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">Zend_Service_Delicious</span><span style="color: #007700">(</span><span style="color: #0000BB">DELICIOUS_USERNAME</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">DELICIOUS_PASSWORD</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;fetch&nbsp;all&nbsp;recent&nbsp;posts<br /></span><span style="color: #0000BB">$posts&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$delicious</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getRecentPosts</span><span style="color: #007700">();<br /><br />echo&nbsp;</span><span style="color: #DD0000">"Found&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">count</span><span style="color: #007700">(</span><span style="color: #0000BB">$posts</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">"&nbsp;post(s)\n"</span><span style="color: #007700">;<br />echo&nbsp;</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">//&nbsp;loop&nbsp;over&nbsp;all&nbsp;$posts<br /></span><span style="color: #007700">foreach&nbsp;(</span><span style="color: #0000BB">$posts&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$index&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$post</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"$index.\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&nbsp;&nbsp;Title:&nbsp;{$post-&gt;getTitle()}\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&nbsp;&nbsp;Url:&nbsp;&nbsp;&nbsp;{$post-&gt;getUrl()}\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&nbsp;&nbsp;Desc:&nbsp;&nbsp;{$post-&gt;getNotes()}\n"</span><span style="color: #007700">;<br />}<br /></span>
</span>
</code>