Source Code: delicious

<!--links-->
<?php 


    
function deliciousLinks($count,$username,$tag) {
            
        if(
$username == '') {
            
$username "gotfoo";
        }
        
        
$title "del.icio.us: ";
        if(
$count == 0){
            
$count 10;    
        }
        
$tags = array();
        
$tags[0] = $tag;

        
$json_url 'http://del.icio.us/feeds/json/' rawurlencode($username);
        
$json_url.= count($tags) ? '/' rawurlencode(implode('+'$tags)) : '';
        
$json_url.= '?count=' . ((int) $count) . '&callback=deliciousLinks_results';
    
        echo 
"<h2>".$title.": ".$tag."</h2>";
        
?>
        <p id="delicious-box" style="margin:0;padding:0;border:none;"> </p>
            <script type="text/javascript" src="<?php echo $json_url?>"></script>
            <script type="text/javascript">
                
            /*function showImage(img){ return (function(){ img.style.display='inline'; }) }
            var ul = document.createElement('ul');
            for (var i=0, post; post = Delicious.posts[i]; i++) {
                var li = document.createElement('li');
                var a = document.createElement('a');
                a.setAttribute('href', post.u);
                a.appendChild(document.createTextNode(post.d));
                li.appendChild(a);
                ul.appendChild(li);
            }
            ul.setAttribute('id', 'delicious-list');
            document.getElementById('delicious-box').appendChild(ul);*/
            </script>
<?php
        
}    
        
    function 
deliciousTags($count,$username) {
            
        if(
$username == '') {
            
$username "gotfoo";
        }
        
        
$title "del.icio.us Links";
        if(
$count == 0){
            
$count 10;    
        }
        

        
$json_url 'http://del.icio.us/feeds/json/tags/' rawurlencode($username);
        
        
$json_url.= '?count=' . ((int) $count) . ';';
    
        
        
?>
        <p id="delicious-box" style="margin:0;padding:0;border:none;"> </p>
            <script type="text/javascript" src="<?php echo $json_url?>"></script>
            <script type="text/javascript">
            
            var ct = document.getElementById('tags-container');
            for (var k in Delicious.tags) {
                var count = Delicious.tags[k];
                var span = document.createElement('li');
                var a = document.createElement('a');
        
                a.setAttribute('href', 'links.php?usr=<?php echo $username?>&tag='+k);
                a.setAttribute('onclick','');
                a.appendChild(document.createTextNode(k +' ('+count+')'));
                span.appendChild(a);
                span.appendChild(document.createTextNode(' '));
                ct.appendChild(span);
            }
            </script>
<?php
        
}    
        
?>
<script>

    function deliciousLinks_results(obj) {
        var ul = document.createElement('ul');
        for (var i=0, post; post = obj[i]; i++) {
            var li = document.createElement('li');
            var a = document.createElement('a');
            a.setAttribute('href', post.u);
            a.appendChild(document.createTextNode(post.d));
            li.appendChild(a);
            ul.appendChild(li);
        }
        ul.setAttribute('id', 'delicious-list');
        document.getElementById('delicious-box').appendChild(ul);
    }
      
    
</script>
<div id="content">
<p>This page gets all of the public bookmarks for a user ('gotfoo') from del.icio.us using a JSON Request.  Type in a del.icuo.us Username and a tag.<br>
<a href=""><strong>Source Code</strong></a>
</p>
<form action="delicious.php" method="GET">
<p>Username: <input type="textbox" id="usr" name="usr" size="20" value="<?php echo $_GET['usr']; ?>"> Tag: <input type="textbox" id="tag" name="tag" size="20" value="<?php echo $_GET['tag']; ?>">  <input type="submit" value="Search"></p>
</form>
<?php 
    
    $username 
$_GET['usr'];
    
$tag $_GET['tag'];

    
deliciousLinks('20',$username,$tag); 
    
    
?>

    
</div>
<div id="subcontent" >
<div class="small box">
<h2>Tags</h2>
<ul class='menublock' id='tags-container'></ul>
<?php
 deliciousTags
('20',$username); 
?>
</div>

</div>