Delicious tag cloud using Zend framework


Posted in: php | Save to del.icio.us | Twit This! 7 Apr 2008

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




Share this post

Share on Facebook
Share on Twitter
Share on StumbleUpon
Share on Delicious
Share on Digg
Share on Technorati
Share on Reddit
Feeds RSS Subscribe to site Feed

Other related posts



3 Responses

1

kiran aghor

April 8th, 2008 at 8:28 am

kool. How easy it that…

2

mcguillan

August 10th, 2009 at 2:13 am

The script does not work properly, because the max is unknown at the beginning.

3

mcguillan

August 10th, 2009 at 2:22 am

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;
}

Comment Form

Use the html <code> tag to insert small source code snippets

For longer code examples use http://pastie.org/.

Get latest updates by E-mail

About this blog

This site is a digital habitat of Sameer, a freelance web developer working from Pune.More

Recent Comments

  • sameer: Check to see if the 'IDE > options > format' is set to HTML. [...]
  • sameer: Google strips any newline characters form the text. Although it does accept it with the online trans [...]
  • Arjan: Fiddler is a debugging tool for IE (not Microsoft's Fiddler) [...]
  • Susan Martin: while creating a test for site, command icons on IDE greyed out and do not respond when selected. I [...]
  • Saar: Thanks for this example. helped me a lot. I have 1 problem, I am translating chunks of code, but I [...]
  • sameer: You can add extra GET variables in the options array as below: $pager_options = array( 'mode [...]
  • Martin: How can you carry over your own variables into the URL? I am using a form to POST a couple of var [...]
  • nancy: thanks very much ! first tools [...]

  • Users Online

    • 11 Users Online
    • 7 Guests, 4 Bots