The Delicious tagroll for WordPress plugin adds a new shortcode to WordPress, the shortcode. The shortcode creates a tag cloud or a list of tags (see parameters below).


Demo: https://soderlind.no/bookmarks/

Plugin: You'll find the plugin at https://wordpress.org/extend/plugins/delicious-tagroll-shortcode/

Installation: Download the plugin and save it in wp-content/plugins (remember to activate in Plugins) or wp-content/mu-plugins or install it from inside WordPress in Plugins->Add New (search for "delicious tagroll")

Usage: Add the shortcode to a Page. The shortcode supports the following parameters:

  • Mandatory:
    • username="delicious username" (if you forget it, my tagroll is displayed instead ;))
  • Optional:
    • title="tagroll title" (default ="My Delicious Tags", use " " if you don't want a tagroll title)
    • count="number of tags" (default="100")
    • sort="alpha or freq" (default = "alpha")
    • showcounts="true or false" (default = "false", show tag counts)
    • mincount (default mincount="10"), eg. show only tags with 10 or more links
    • minfont="12"
    • maxfont="35"
    • tags (default empty), eg. used to filter which tags you'd like to display eg. tags="javascript,jquery,nodejs

Change log

v 2.1.2

  • Bugfix, you need this one if you are running a version less than PHP 5.3, since $xml->channel->item->count() is only supported in PHP 5.3 and newer.
    <br />
    function ps_delicious_tagroll_get_tags($username = 'soderlind',$count = 10){</p>
    <p>	$key = 'delicious_tagroll_' . $username;</p>
    <p>	$feed_url = sprintf(&quot;https://feeds.delicious.com/v2/rss/tags/%s?count=%s&quot;,$username,$count);</p>
    <p>	$rs = get_transient($key);									// read &quot;cache&quot;<br />
    	if ($rs != false) return $rs;</p>
    <p>	$data  = wp_remote_get($feed_url.'');<br />
    	if (is_wp_error($data)) {<br />
    		return (array)get_option($key); 						// retrieve fallback<br />
    	} else {<br />
    		$body = wp_remote_retrieve_body($data);<br />
    		$xml = new SimpleXMLElement($body);<br />
    		$rs = json_decode(json_encode($xml-&gt;channel),TRUE);	// convert xml object to array<br />
    		if (count($rs['item']) &gt; 0) {<br />
    			set_transient($key, $rs, 60*60);					//expire after 1 hour<br />
    			update_option($key, $rs); 							//fallback storage<br />
    		} else {<br />
    			$rs = (array)get_option($key); 						// retrieve fallback<br />
    		}<br />
    		return $rs;<br />
    	}<br />
    }<br />

v 2.1.1

  • Replaced LastRSS with WordPress built in methods and set/get transient for caching:
    <br />
    function ps_delicious_tagroll_get_tags($username = 'soderlind',$count = 10){</p>
    <p>	$key = 'delicious_tagroll_' . $username;</p>
    <p>	$feed_url = sprintf(&quot;https://feeds.delicious.com/v2/rss/tags/%s?count=%s&quot;,$username,$count);</p>
    <p>	$rs = get_transient($key);									// read cache<br />
    	if ($rs != false) return $rs;</p>
    <p>	$data  = wp_remote_get($feed_url.'');<br />
    	if (is_wp_error($data)) {<br />
    		return (array)get_option($key); 						// retrieve fallback<br />
    	} else {<br />
    		$body = wp_remote_retrieve_body($data);</p>
    <p>		$xml = new SimpleXMLElement($body);</p>
    <p>		if ($xml-&gt;channel-&gt;item-&gt;count() &gt; 0) {<br />
    			$rs = json_decode(json_encode($xml-&gt;channel),TRUE);	// convert xml object to array<br />
    			set_transient($key, $rs, 60*60);					//save cache, expire after 1 hour<br />
    			update_option($key, $rs); 							//save fallback<br />
    		} else {<br />
    			$rs = (array)get_option($key); 						// retrieve fallback<br />
    		}<br />
    		return $rs;<br />
    	}<br />
    }<br />
  • Added a new optional attribute:
    • tags (default empty), used to filter which tags you'd like to display eg. tags="javascript,jquery,nodejs"

v 2.0

  • Delicious removed their JavaScript feed so I had to do a total rewrite
    • Creates the tag cloud server-side (good for SEO) and lets you change the look and feel using the included style sheet.
    • Uses the Delicious RSS feed API
    • Caches the feed for one hour. Delicious might block you if you access their feed API too often.
  • Some attributes are removed from the shortcode (you can change these using the ps_delicious_tagroll.css style sheet in the plugin directory):
    • mincolor
    • maxcolor
    • flow
  • Also removed the attributes
    • showname
    • showadd
    • icon
  • Added a new attribute:
    • mincount (default mincount="10"), eg. show only tags with 10 or more links

v 1.1

  • changed parameter name="true" to showname="true"
  • added missing parameter showcounts="false"

v 1.0

  • initial release