Foros del Web » Programando para Internet » ASP Clásico »

nube de tags en asp

Estas en el tema de nube de tags en asp en el foro de ASP Clásico en Foros del Web. hola he encontrado este script para crear nube de tags cloud tags o nube de etiquetas. Código PHP: <% @ Language = "VBScript"  %> <% '============================================================ ...
  #1 (permalink)  
Antiguo 07/03/2008, 15:59
Avatar de engonga
Usuario no validado
 
Fecha de Ingreso: marzo-2002
Ubicación: Buenos Aires
Mensajes: 1.300
Antigüedad: 22 años, 2 meses
Puntos: 8
nube de tags en asp

hola he encontrado este script para crear nube de tags cloud tags o nube de etiquetas.

Código PHP:
<% @Language="VBScript" %>
<%
'============================================================
APP:            TagCloud
' AUTHOR:     © www.u229.no
CREATED:    October 2006
'============================================================
ROUTINES:
' - Function ReadRSSTags()
Sub BubbleSort(byRef a)
'============================================================
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
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>TagCloud</title>
<style type="text/css">
#tagCloud {font-family: verdana; width: 300px; border: 1px solid gray; padding: 5px 0px 5px 0px; text-align: center; font-weight: bold;}
.tag1 {font-size: 12px;}
.tag2 {font-size: 18px;}
.tag3 {font-size: 24px;}
</style>
</head>
<body>
<h3>TAG CLOUD MADE FROM A BBC FEED:</h3>
<%
Dim m_sTags
Dim m_aTags
Dim m_sSmallWords
Dim m_sCurrent, m_sLast
Dim m_bMatch
Dim m_iWordCount
Dim m_sHTML
Dim i, iMax
'
// READ THE RSS FILE AND REMOVE SOME COMMON CHARACTERS
m_sTags Replace(Replace(Replace(Replace(Replace(Replace(ReadRSSTags"?"""), "!"""), "."""), ","""), "-"""), ":""")
'// THESE ARE THE SMALL WORDS THAT WE DON'T CARE ABOUT. INCLUDE MORE WORDS IF YOU LIKE.
m_sSmallWords " in a an and or but for to it that this those these all on off can will no not we will be more new up down over you they get one two three four five six seven eight nine ten nobody now back after yes no like "
'// STORE THE WORDS (TAGS) IN AN ARRAY
m_aTags = Split(m_sTags, " ")
m_iWordCount = 1
m_bMatch = False
'
// SORT THE WORDS ALPHABETICALLY. THIS MAKES THEM EASIER TO COUNT.
Call BubbleSort(m_aTags)
m_sHTML "<div id=""tagCloud"" title=""Hot topics right now"">"
iMax UBound(m_aTags)
'// LOOP THE WORDS
    For i = 0 To iMax
        m_sCurrent = m_aTags(i)
        '
// WE FOUND A MATCH!
        
If m_sCurrent m_sLast Then
            m_bMatch 
True
            m_iWordCount 
= (m_iWordCount 1)
        Else
            If 
m_bMatch Then
                
If m_iWordCount 1 Then
                    
If Not InStr(m_sSmallWordsLCase(m_sLast)) > 0 Then
                        
'// THIS IS OUR SIMPLE WEIGHING ALGORITHM: WE DON'T CARE ABOUT WORDS APPEARING JUST ONE TIME.
                        If 
m_iWordCount 2 Then m_sHTML m_sHTML "<span class=""tag1"">" m_sLast "</span> "
                        
If m_iWordCount 3 Then m_sHTML m_sHTML "<span class=""tag2"">" m_sLast "</span> "
                        
If m_iWordCount 3 Then m_sHTML m_sHTML "<span class=""tag3"">" m_sLast "</span> "
                    
End If
                
End If
            
End If
            
m_iWordCount 1
        End 
If
        
        
m_sLast m_sCurrent
    Next
'// OUTPUT THE TAG CLOUD
Response.Write m_sHTML & "</div></body></html>"
'
------------------------------------------------------------------------------------------------------------
' Comment: Load RSS file from disk.
'
------------------------------------------------------------------------------------------------------------
Function 
ReadRSSTags()
    
On Error Resume Next
    Dim oXML
oNodeoNodeListsRetVal
    Set oXML 
CreateObject("MSXML2.DOMDocument.6.0")
    If 
Err Then
        On Error Resume Next
        Set oXML 
CreateObject("MSXML2.DOMDocument.3.0")
    
End If
    
With oXML
        
.async False
        
If Not .Load(Server.MapPath("bbc.xml")) Then Set oXML Nothing: Exit Function
    
End With
    Set oNodeList 
oXML.selectNodes("//item")
    If 
oNodeList.length 0 Then
        
For Each oNode In oNodeList
            sRetVal 
sRetVal oNode.selectSingleNode("title").Text Chr(32)
        
Next
    End 
If
    
Set oNodeList Nothing
    Set oXML 
Nothing
    ReadRSSTags 
sRetVal
End 
Function
'------------------------------------------------------------------------------------------------------------
CommentSort the tagshttp://www.4guysfromrolla.com/demos/bubblesort.asp
------------------------------------------------------------------------------------------------------------
Sub BubbleSort(ByRef a)
    
On Error Resume Next
    Dim i
jiMax
    Dim Start
iNewswap
    iMax 
UBound(a)
    For 
0 To iMax 1
        Start 
a(i)
        
iNew a(i)
        
swap i
            
        
For 1 To iMax
            
If a(j) < iNew Then
                swap 
j
                iNew 
a(j)
            
End If
        
Next
        
        
If swap <> i Then
            a
(swap) = Start
            a
(i) = iNew
        End 
If
    
Next
End Sub
%> 

el xml de donde saca los datos es este

Código PHP:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml
-stylesheet title="XSL_formatting" type="text/xsl" href="/shared/bsp/xsl/rss/nolsol.xsl"?>
<rss version="2.0"><channel>
 <title>BBC News | World | UK Edition</title>
 <link>http://news.bbc.co.uk/go/rss/-/1/hi/world/default.stm</link>
 <description>Visit BBC News for up-to-the-minute news, breaking news, video, audio and feature stories. BBC News provides trusted World and UK news as well as local and regional perspectives. Also entertainment, business, science, technology and health news.</description>
 <language>en-gb</language>
 <lastBuildDate>Wed, 04 Oct 2006 23:09:19 GMT</lastBuildDate>
 <copyright>Copyright: (C) British Broadcasting Corporation, see http://news.bbc.co.uk/1/hi/help/rss/4498287.stm for terms and conditions of reuse</copyright>
 <docs>http://www.bbc.co.uk/syndication/</docs>
 <ttl>15</ttl>
  
  <image>
   <title>BBC News</title>
   <url>http://news.bbc.co.uk/nol/shared/img/bbc_news_120x60.gif</url>
   <link>http://news.bbc.co.uk/go/rss/-/1/hi/world/default.stm</link>
  </image>
  
   
    
    
     <item>
        <title>Rice pledges US support for Abbas</title>
        <description>US Secretary of State Condoleezza Rice seeks to boost beleaguered Palestinian leader Mahmoud Abbas.</description>
        <link>http://news.bbc.co.uk/go/rss/-/1/hi/world/middle_east/5404998.stm</link>
 
  <guid isPermaLink="false">http://news.bbc.co.uk/1/hi/world/middle_east/5404998.stm</guid>
  <pubDate>Wed, 04 Oct 2006 17:29:48 GMT</pubDate>
  <category>Middle East</category>
  
 
 
</item>
    
   
   
         
   
    
    
     <item>
        <title>'Nine soldiers killed' in Nigeria</title>
        <description>A Nigerian militant group says it has killed nine government soldiers in a gun battle in the Niger Delta.</description>
        <link>http://news.bbc.co.uk/go/rss/-/1/hi/world/africa/5408118.stm</link>
 
  <guid isPermaLink="false">http://news.bbc.co.uk/1/hi/world/africa/5408118.stm</guid>
  <pubDate>Wed, 04 Oct 2006 20:35:16 GMT</pubDate>
  <category>Africa</category>
  
 
 
</item>
 
 
</channel>
</rss>
Lo dejo para si a alguien le interesa


ahora investigare de como sacar los datos de una base de datos (si alguien sabe que postee gracias)
  #2 (permalink)  
Antiguo 12/04/2008, 08:55
 
Fecha de Ingreso: febrero-2008
Mensajes: 296
Antigüedad: 16 años, 3 meses
Puntos: 2
Re: nube de tags en asp

Hola, me interesa el script pero en phpl. alguien sabe como hacerlo, pero sin base de datos?
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:05.