<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/basededatos.asp" -->
<!--#include file="scripts/fecha.inc" -->

<%
Dim Datos
Dim Datos_cmd
Dim Datos_numRows

Set Datos_cmd = Server.CreateObject ("ADODB.Command")
Datos_cmd.ActiveConnection = MM_basededatos_STRING
Datos_cmd.CommandText = "SELECT * FROM noticias ORDER BY Fecha DESC, ID DESC" 
Datos_cmd.Prepared = true

Set Datos = Datos_cmd.Execute
Datos_numRows = 0
%>
<%
CurrDate = Now()
CurrHour = Hour(CurrDate)
if CurrHour < 10 then CurrHour = "0" & CurrHour
CurrMin = Minute(CurrDate)
if CurrMin < 10 then CurrMin = "0" & CurrMin
CurrSec = Second(CurrDate)
if CurrSec < 10 then CurrSec = "0" & CurrSec
CurrDateT = WeekdayName(Weekday(CurrDate), TRUE) & ", " & Day(CurrDate) & " " & _
MonthName(Month(CurrDate), TRUE) & " " & Year(CurrDate) & " " & _
CurrHour & ":" & CurrMin & ":" & CurrSec & " GMT" 

Encabezado = "<?xml version='1.0' encoding='ISO-8859-1'?>" & vbCrlf
Encabezado = Encabezado & "<?xml-stylesheet type=""text/xsl"" href=""http://www.ojoandroid.com/rss.asp"" ?>" & vbCrlf
Encabezado = Encabezado & "<rss version=""2.0"" xmlns:content=""http://purl.org/rss/1.0/modules/content/"" xmlns:wfw=""http://wellformedweb.org/CommentAPI/"">" & vbCrlf & vbCrlf

Encabezado = Encabezado & "<channel>" & vbCrlf
Encabezado = Encabezado & "<title>OjoANDROID.com, blog sobre juegos, aplicaciones, noticias, tutoriales, root, ROM en la Plataforma ANDROID</title>" & vbCrlf
Encabezado = Encabezado & "<link>http://www.ojoandroid.com/</link>" & vbCrlf
Encabezado = Encabezado & "<description>OjoANDROID.com, blog sobre juegos, aplicaciones, noticias, tutoriales, root, ROM en la Plataforma ANDROID</description>" & vbCrlf
Encabezado = Encabezado & "<lastBuildDate>"  & CurrDateT & "</lastBuildDate>" & vbCrlf
%>
<%
Response.ContentType = "text/xml"
Response.Write(Encabezado)
Response.Write("<language>es-ES</language> " & vbcrlf) 
Response.Write("<copyright>COPYRIGHT 2016 OjoANDROID.com</copyright>" & vbcrlf & vbcrlf) 
%>
<%
i = 1
While i < 301 AND Not Datos.EOF
%>
<%
NuevoLink = "http://www.ojoandroid.com/blog_proc.asp?Seleccion=" & (Datos.Fields.Item("ID").Value)
NuevoLink = "http://www.ojoandroid.com/" & (Datos.Fields.Item("ID").Value) &"-"& URLamigable(Datos("Titular").Value)

CurrDate = (Datos.Fields.Item("Fecha").Value)
CurrHour = Hour(CurrDate)
if CurrHour < 10 then CurrHour = "0" & CurrHour
CurrMin = Minute(CurrDate)
if CurrMin < 10 then CurrMin = "0" & CurrMin
CurrSec = Second(CurrDate)
if CurrSec < 10 then CurrSec = "0" & CurrSec
CurrDateT = WeekdayName(Weekday(CurrDate), TRUE) & ", " & Day(CurrDate) & " " & _
MonthName(Month(CurrDate), TRUE) & " " & Year(CurrDate) & " " & _
CurrHour & ":" & CurrMin & ":" & CurrSec & " GMT" 

%>
<%
   response.write "<item>"
   response.write "<title><![CDATA[" & (Datos.Fields.Item("Titular").Value) & "...]]></title>"
   response.write "<link>" & NuevoLink & "</link>"
   response.write "<pubDate>" & CurrDateT & "</pubDate>"
   response.write "<description><![CDATA[<img src=""http://www.ojoandroid.com/archivos/" & Datos("Foto") & ".jpg"" alt=""" & Datos("Titular")& """ title=""" & Datos("Titular") & """  /><br>" & Replace((Datos.Fields.Item("Resumen").Value),CHR(10)," ") &"]]></description>"
   response.write "</item>"  & vbcrlf  & vbcrlf
%>
<%
i = i + 1
Datos.Movenext
Wend
%>
<%
Response.Write( vbcrlf & "</channel>" & vbcrlf & "</rss>")
%>
<%
Datos.Close()
Set Datos = Nothing
%>
