Integrating the Tag Cloud via XML
The terms for the Tag Cloud may be requested via the XML interface and subsequently displayed in the corresponding page.
To request the terms, simply call the following URL:
$stringEscapeUtils.escapeHtml($body)
Replace the channel name with the name of your channel. If you do not wish to display the maximum number of search terms, you may limit the data returned with the “wordCount
” parameter. The following call would return a maximum of only 30 terms:
$stringEscapeUtils.escapeHtml($body)
Result structure
When the above URL is called, the data will be returned in the format shown in this example:
<tagCloud xsi:noNamespaceSchemaLocation="schema/7.2/fftagcloud.xsd">
<entry nr="0" weight="0.409583306449226" searchCount="18">buzz</entry>
<entry nr="1" weight="1.0" searchCount="42">call of duty</entry>
<entry nr="2" weight="0.3697540052250177" searchCount="17">fallout 3</entry>
<entry nr="3" weight="0.8527549493124068" searchCount="34">gta</entry>
<entry nr="4" weight="0.06641433178656121" searchCount="11">harry potter</entry>
...
</tagCloud>
entry
One term for the Tag Cloud is listed in each “entry” tag. The individual attributes of the tags provide the information that should be used for an appropriate display.
nr
Consecutive numbering of each term in the Tag Cloud. The numbering begins with 0 (zero).
weight
Weight (emphasis value) for the term. This value may be used (for example) to set the font size for each term. The weight is expressed as a floating-point number from 0 to 1, where 1 is the most important term.
Use a Standard function to calculate the font size is as follows:
fontSize = minFontSize + Math.round((maxFontSize - minFontSize) * weight);
The values for minFontSize
and maxFontSize
may be adjusted according to taste.
searchCount
The count of how many times the corresponding term was searched for in the time period.
url
This attribute is only returned if SEO Enhancer has been enabled. In this case the attribute contains the SEO path.
Example for an entry
element in this case:
<entry nr="1" weight="1.0" searchCount="42" url="?seoPath=%2Fcall+of+duty%2Fq&channel=channelName">call of duty</entry>