By Bumgardner J.

Tag clouds are in every single place on the internet nowadays. First popularized through the internet websites Flickr, Technorati, and, those amorphous clumps of phrases now look on a slew of sites as visible proof in their club within the elite corps of "Web 2.0. This PDF analyzes what's and is not a tag cloud, bargains layout counsel for utilizing them successfully, after which is going directly to express the best way to gather tags and exhibit them within the tag cloud layout. Scripts are supplied in Perl and PHP.Yes, a few have acknowledged tag clouds are a fad. yet as you will see that, tag clouds, whilst used accurately, have actual benefits. extra importantly, the abilities you examine in making your individual tag clouds make it easier to make different fascinating types of interfaces that would live longer than the mercurial fads of this 12 months or the subsequent.

Show description

Read Online or Download Building Tag Clouds in Perl and PHP PDF

Best programming: programming languages books

Thinking in Java (One-Off)

Pondering in Java, 3rd version is the much-anticipated revision of Bruce Eckel's best-selling creation to Java. In considering in Java, 3/e, Bruce Eckel presents entire integration of JDK 1. four applied sciences to his award profitable 'Thinking in' presentation. Eckel introduces the entire fundamentals of gadgets as Java makes use of them, then walks conscientiously during the primary ideas underlying all Java programming -- together with application movement, initialization and cleanup, implementation hiding, reusing sessions, and polymorphism.

C# 2010 for Programmers (4th Edition) (Deitel Developer Series)

Written for programmers with a history in C++, Java or different high-level, object-oriented languages, this publication applies the Deitel signature live-code method of educating programming and explores Microsoft’s C# 2010 language and . web four extensive. The ebook is up to date for visible Studio® 2010 and C# four, and provides C# techniques within the context of totally proven courses, entire with syntax shading, specified line-by-line code descriptions and application outputs.

Additional resources for Building Tag Clouds in Perl and PHP

Example text

The result is shown in Figure 19. Figure 19. php Note: Figures 19 thru 28 (in the PHP section) exactly duplicate Figures 9 thru 18 (in thePerl section). I did this to keep illustrations inline with the text, so that PHPprogrammers don't have to keep flipping back to the Perl section. As you can see, the words in Figure 19 are far too small. We probably don't wantto see a font size smaller than about te so let's add ten to the count. We'llchange the line that converts tag count to font size from this: $fsize = $cnt; 39 40 to this: $fsize = $cnt+10; This change produces the tag cloud shown in Figure 20.

Figure 23. A power curve There tends to be a very few large values in the data, and lots and lots of small values. The problem with mapping a power curv to a limited set of font sizes is that the "long tail" of the power curve ends up getting represented by just one or two font sizes. Many of the intermediate font sizes won't get used at all because of the larger gaps between the counts of the most popular word The way to make this tag cloud look better is to use a logarithmic function to reverse the power curve's effects.

Collect delicious tags (or load them from a cache) function getTags() { global $tags; Again, the script contains a single function, getTags(), which is responsible forbuilding up the global associative array, $tags. If one is specified in the URL parameters, it will be used, otherwise, my account,'jbum' will be used. // remove troublesome characters from name 36 37 $who = preg_replace('/\W/', '',$who); Since this script is intended to be used on a web site, we have to be careful thatuser don't enter invalid data that causes unintentional side effects, so we removeall alphanumeric characters from the name, to reduce the security risks that mightcome from accessing unfiltered URLs.

Download PDF sample

Rated 4.45 of 5 – based on 3 votes