Tema: Rss
Ver Mensaje Individual
  #4 (permalink)  
Antiguo 17/08/2006, 17:15
Avatar de darom
darom
 
Fecha de Ingreso: agosto-2006
Mensajes: 43
Antigüedad: 18 años, 3 meses
Puntos: 0
Te paso el codigo para que te des una idea. Cualquier duda consultame, ojo no soy programador , pero tratare de ayudarte.

la pagina debe llamarse rss.asp (por ejemplo)

<%
'DSN-Less database connection
Query="SELECT * from tabla ORDER by Id DESC"
Set DataConn = Server.CreateObject("ADODB.Connection")
DataConn.Open "DBQ=" & Server.Mappath(".tubase de datos.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"
Set RSlist = Server.CreateObject("ADODB.recordset")
RSlist.Open Query,DataConn,3

'XML OUTPUT

Dim fldF
Response.ContentType = "text/xml"
Response.Write "<?xml version=""1.0"" encoding=""iso-8859-1"" ?>" & vbCrlf
Response.Write "<rss version=""2.0"">" & vbCrlf
Response.Write "<channel>" & vbCrlf
Response.Write "<description>tu descripcion.</description>" & vbCrlf
Response.Write "<language>es-ar</language>" & vbCrlf
Response.Write "<managingEditor>tu mail de editor</managingEditor>" & vbCrlf
Response.Write "<webMaster>tu mail de webmaster</webMaster>" & vbCrlf
Response.Write "<copyright>© 2000-2006 tu copyright</copyright>" & vbCrlf
Response.Write "<image>" & vbCrlf
Response.Write "<title>Tu titulo</title>" & vbCrlf
Response.Write "<link>tu_link</link>" & vbCrlf
Response.Write "<url>trl_de_imagen</url>" & vbCrlf
Response.Write "<width>120</width>" & vbCrlf
Response.Write "<height>35</height>" & vbCrlf
Response.Write "</image>" & vbCrlf


'A loop to collect all the articles
cantidad= 0
Do While Not cantidad = 15 OR RSList.EOF
cantidad = cantidad + 1

Response.Write "<item>" & vbCrlf
Response.Write "<title>" & RSlist("titulo").Value & "</title>" & vbCrlf
Response.Write "<link>tu_enlace_ a las noticias.asp?id="& RSlist("id").Value &"</link>" & vbCrlf
Response.Write "<description>" & vbCrlf
Response.Write "<![CDATA[" & vbCrlf
Response.Write RSlist("copete").Value & "]]>" & vbCrlf
Response.Write "</description>" & vbCrlf
Response.Write "</item>" & vbCrlf


RSlist.MoveNext
Loop
Response.Write "</channel>" & vbCrlf
Response.Write "</rss>" & vbCrlf

RSList.Close
set RSList = nothing
%>