Home PHP and MySQL CodeCode PoetryPoetry Articles I've writtenArticles My ResumeResume PicturesPictures Left Circle StoriesCircle Blog Circle TreoPix
Me
Cal Evans . Com - The life, love, code, and bad poetry of Cal Evans.
Latest Additions:



TagCloud Maker


Current Version: 1.2
Copyright 2006 Cal Evans
License GPL 2.0

Source Code

Example Page

Check out the example page. The keywords from the sample page come from the last 30 entries of my blog. I'll admit I cheated and just open the database and pull them from there instead of trying to call my blog w/curl or fopen and parse it. (Although that would have been cooler.) I then ran each blog entry against Yahoo's Term Extraction API to get the terms. Then I pumped that array into my new TagCloud maker. The important code you can't see from the index.php is below.


require_once('cal/TagCloud.php');
$o = new Cal_TagCloud($thisArray);
$o->setSpacer("   ")
->setMaxTags(25)
->setShowScore('score')
->setLink('http://www.technorati.com/tags/%s')
->buildCloud();
$y = $o->outputCloud;


This version does away with the static calls but does allow you to use "fluent interfaces".



Spacer
gunther logo  Last modified: Wed, 13 December 2006 (10:28:54 AM)