<% '======================================================================== ' APP: Tenbyten ' AUTHOR: © www.u229.no ' CREATED: November 2006 '======================================================================== ' COMMENT: Create a Tag Cloud/Tag Wall based on data collected from http://www.tenbyten.org/. ' This Tag Cloud will always display the current world news. '======================================================================== ' ROUTINES: ' - Function CreateTagCloud() ' - Function DownloadWords() '======================================================================== Option Explicit On Error Resume Next With Response .ExpiresAbsolute = #1/1/1980# .AddHeader "cache-control", "no-cache, must-revalidate" .AddHeader "pragma", "no-cache" .AddHeader "Content-Type", "text/html; charset=UTF-8" End With Const PROGID_60 = "MSXML2.SERVERXMLHTTP.6.0" '// PROG ID'S FOR THE MS XML OBJECT Const PROGID_30 = "MSXML2.XMLHTTP.3.0" Const MAX_WORDS = 9 '// NUMBER OF WORDS FOR THE TAG CLOUD (MAX 100) Const TENBYTEN_URL = "http://www.tenbyten.org/Data/Now/words.txt" %> <% '// Create the tag cloud Response.Write CreateTagCloud '------------------------------------------------------------------------------------------------------------ ' Comment: '------------------------------------------------------------------------------------------------------------ Function CreateTagCloud() On Error Resume Next Dim aWords, sCSS, i sCSS = "
In The World News:" aWords = Split(DownloadWords, Chr(10)) For i = 0 To MAX_WORDS If i = 0 Then sCSS = sCSS & "" & aWords(i) & " " If i > 0 And i < 4 Then sCSS = sCSS & "" & aWords(i) & " " If i > 3 Then sCSS = sCSS & "" & aWords(i) & " " Next CreateTagCloud = sCSS & "
" End Function '------------------------------------------------------------------------------------------------------------ ' Comment: '------------------------------------------------------------------------------------------------------------ Function DownloadWords() On Error Resume Next Dim oXmlHttp '// FIND XML OBJECT INSTALLED ON THIS SERVER Set oXmlHttp = CreateObject(PROGID_60) If Err Then On Error Resume Next Set oXmlHttp = CreateObject(PROGID_30) End If With oXmlHttp .Open "GET", TENBYTEN_URL, False .Send "" DownloadWords = .responseText End With Set oXmlHttp = Nothing End Function %>