Delicious tag cloud using Zend framework

Zend framework provides many interesting wrappers for major service APIs like Akismet, Amazon, Audioscrobbler, Delicious, Flickr, Nirvanix, etc.

In this post we will use the delicious wrapper to create a tag cloud for your delicious account.


sdsd.


Now that we have all the tags with us we will display them as a cloud with weight attached to each tag. The font size of each tag will be set depending on the number of posts for that particular tags. For e.g a tag named “php” having 45 posts will have the font size set to 30 px while a tag “flash” having 2 posts will have the font size set to 10 px.


sdsd.


Here’s what the output will look like. The tags visited are in blue.


sdsd.


Download code

3 thoughts on “Delicious tag cloud using Zend framework

  1. In order to make it work you just have to add another foreach before the foreach with the print to get the min and max:

    foreach ($tags as $tagName=>$tagCount)
    {
    $cnt = $tagCount;

    if ($cnt > $maxTagCount) $maxTagCount = $cnt;
    if ($cnt < $minTagCount) $minTagCount = $cnt;
    }

Comments are closed.