Posted in Misc | Posted on 01-07-2009 | 2,467 views
Earlier today someone suggested adding a tag cloud to ColdFusionBloggers. I'm just enough of a nerd to think that would be something fun to do Friday night. In the meantime, I whipped up a quick SQL statement and dumped the results into a structure and sorted it:
2select categories
3from entries
4where year(posted) = 2008
5and categories != ''
6</cfquery>
7
8<cfset d = {}>
9<cfloop query="cats">
10 <cfloop index="c" list="#categories#">
11 <cfif len(trim(c))>
12 <cfif not structKeyExists(d, c)>
13 <cfset d[c] = 0>
14 </cfif>
15 <cfset d[c]++>
16 </cfif>
17 </cfloop>
18</cfloop>
19
20<cfoutput>
21#numberFormat(cats.recordcount)# entries.
22<p/>
23<table border="1" cellpadding="10" style="margin-top:0px;padding-top:0px;">
24 <tr>
25 <th> </th>
26 <th>Tag</th>
27 <th>Count</th>
28 </tr>
29</cfoutput>
30
31<cfset sorted = structSort(d,"numeric", "desc")>
32
33<cfloop index="x" from="1" to="#min(100,arrayLen(sorted))#">
34 <cfset k = sorted[x]>
35 <cfoutput>
36 <tr>
37 <td>#x#</td>
38 <td>#k#</td>
39 <td>#numberFormat(d[k])#</td>
40 </tr>
41 </cfoutput>
42</cfloop>
43<cfoutput></table></cfoutput>
Not the prettiest code in the world, but it worked. All 3 of you using copies of the CFB code base are welcome to it. And now the results. I've printed out the top 100. The top ten aren't surprising, especially #2. It almost matches exactly with what my top 10 concerns of year were (except for Lost of course!). ColdBox shows up rather high in the list, well over Model-Glue and Fusebox. I'm not surprised to see Mac at #17.
Anyway, enjoy the table-y goodness (need to find a simple, scrollable table for static data) and forgive the huge page size.
11,813 entries.
| Tag | Count | |
|---|---|---|
| 1 | ColdFusion | 4,098 |
| 2 | Flex | 954 |
| 3 | General | 544 |
| 4 | Adobe | 483 |
| 5 | Air | 396 |
| 6 | conferences | 262 |
| 7 | Misc | 258 |
| 8 | Javascript | 242 |
| 9 | Ajax | 238 |
| 10 | Technology | 205 |
| 11 | ColdBox | 205 |
| 12 | Development | 200 |
| 13 | Flash | 199 |
| 14 | Code | 195 |
| 15 | cfml | 195 |
| 16 | Tools | 193 |
| 17 | Mac | 187 |
| 18 | Programming | 173 |
| 19 | Web Development | 160 |
| 20 | Java | 160 |
| 21 | SQL | 158 |
| 22 | Personal | 147 |
| 23 | Uncategorized | 143 |
| 24 | posts | 141 |
| 25 | Apple | 134 |
| 26 | Open Source | 132 |
| 27 | Linux | 129 |
| 28 | community | 129 |
| 29 | CFEclipse | 112 |
| 30 | Transfer | 107 |
| 31 | jQuery | 105 |
| 32 | business | 104 |
| 33 | MAX | 104 |
| 34 | security | 99 |
| 35 | Eclipse | 97 |
| 36 | cfunited | 95 |
| 37 | Presentations | 92 |
| 38 | ActionScript | 90 |
| 39 | Scotch on the Rocks | 87 |
| 40 | ColdSpring | 87 |
| 41 | Life | 85 |
| 42 | Jobs | 82 |
| 43 | Stuff | 80 |
| 44 | Oracle | 77 |
| 45 | 77 | |
| 46 | iPhone | 76 |
| 47 | Open-Source CF | 72 |
| 48 | Frameworks | 69 |
| 49 | ColdFusion 8 | 68 |
| 50 | Web Dev | 68 |
| 51 | Railo | 68 |
| 52 | Blogging | 67 |
| 53 | Work | 66 |
| 54 | Fun | 66 |
| 55 | AS3 | 66 |
| 56 | Appearances | 66 |
| 57 | AdobeMAX08 | 65 |
| 58 | Microsoft | 63 |
| 59 | BlueDragon | 57 |
| 60 | RIA | 57 |
| 61 | Projects | 57 |
| 62 | Universal Mind | 55 |
| 63 | subversion | 54 |
| 64 | model-glue | 54 |
| 65 | Flex General | 53 |
| 66 | ruby | 52 |
| 67 | Windows | 52 |
| 68 | SixSigns | 51 |
| 69 | fusebox | 51 |
| 70 | BlazeDS | 50 |
| 71 | Adobe AIR | 50 |
| 72 | Apache | 50 |
| 73 | music | 48 |
| 74 | Applications | 47 |
| 75 | Video | 47 |
| 76 | database | 47 |
| 77 | events | 47 |
| 78 | WhosOnCFC | 46 |
| 79 | BlogCFC | 46 |
| 80 | mysql | 46 |
| 81 | Off Topic | 46 |
| 82 | HTML/ColdFusion | 46 |
| 83 | news | 46 |
| 84 | Databases | 46 |
| 85 | Random | 45 |
| 86 | Ubuntu | 45 |
| 87 | openbd | 44 |
| 88 | Default | 44 |
| 89 | .NET | 43 |
| 90 | Ask Ben | 42 |
| 91 | SQL Server | 42 |
| 92 | Reviews | 42 |
| 93 | mapguide | 41 |
| 94 | ANT | 41 |
| 95 | WordPress.com | 40 |
| 96 | Razuna | 40 |
| 97 | collaboration | 40 |
| 98 | Announcements | 40 |
| 99 | CFUG | 39 |
| 100 | design | 39 |


LOL
Hmmm ... Kinda' Like Stats Pod ... Heh
;)
Another great example with code is here:
<a href="http://www.petefreitag.com/item/396.cfm">h...;
@Ray: You started by mention "tag cloud". In my world a tag cloud looks like this:
http://www.smashingmagazine.com/images/tagclouds/p...
Another great example with code is here:
http://www.petefreitag.com/item/396.cfm
@Andy, are you saying there were only 2 smart guys on the author list for the book? :-(
It was kind of like the Oscars. If you try to thank everyone the orchestra just starts playing and cuts to commercial anyway. LOL, seriously though Ray did write the chapter I was talking about - I dusted the book off and checked last night. I've benefited from all of the talented folks who have co-authored CF books going back to the Macromedia MX editions. I've even learned a few tricks from some of your blogs and chapters! :)
[Add Comment] [Subscribe to Comments]