var pzy = jQuery.noConflict();

pzy.getJSON("http://j.im/cifree/delicious/delicious.php?callback=?"); 

// This function extracts the delicious data

function delicious(data) { 

  // Call is creared by the jsonp and is called, data contains both the id and link array items.
	pzy.each(data.links.items, function(i,item){
		  get_tags(item['md5'],item['link'],item['id']);
	})
 	
}

// This function is to do with saving Delicious Tags.

function get_tags(url,location,id) { 

	pzy.getJSON("http://feeds.delicious.com/v2/json/urlinfo/"+ url +"?callback=?",
	 
	   function(data) {   
				var tags = ""; 
				if (data[0]) { 
				
					pzy.each(data[0].top_tags, function(i,item){
						tags += i + ","; 
					})
					
					
				}
				 	pzy.getJSON("http://j.im/cifree/delicious/save.php?id=" + id + "&tags=" + tags);
		});
	 
	}
