1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
| <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
set rs=Server.CreateObject("adodb.Recordset")
set conn=server.createobject("adodb.connection")
DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "
DSNtemp=dsntemp & "DBQ=bdd1.mdb"
%>
<%
conn.open DSNtemp
SQL = "SELECT Top 5 * FROM [rs_actu_rock]"
RS.open SQL, Conn , 3, 3
Response.Charset = "UTF-8"
response.ContentType = "text/xml"
xml = "<?xml version=""1.0"" encoding=""UTF-8""?><rss version=""2.0""><channel>"
xml = xml &"<title>Actualité Rock</title>"
xml = xml &"<link>http://www.monsite.com/</link>
"
xml = xml &"<description>Les dernières nouvelles</description>"
xml = xml &"<managingEditor>freebird@wanadoo.fr (Lynird skynird)</managingEditor>"
xml = xml &"<language>fr</language>"
xml = xml &"<generator>Quadrophenia</generator>"
xml = xml &"<copyright>Quadrophenia</copyright>"
xml = xml &"<webMaster>Quadrophenia Webmaster</webMaster>"
While not RS.eof
id = rs("id_actu")
titre = rs("titre")
news = rs("chapeau")
news = replace(news, "<BR>", "<BR/>")
news = replace(news, "&", "&")
news = replace(news, "<", "<")
news = replace(news, ">", ">")
xml = xml &"<item>"
xml = xml &"<title>"& titre &"</title>"
xml = xml &"<link><a href="http://www.monsite.com/rss.asp?Va" target="_blank">http://www.monsite.com/rss.asp?Va</a>
leurID="& id &"</link>"
xml = xml &"<pubDate>" &" GMT</pubDate>"
xml = xml &"<guid><a href="http://www.monsite.com/rss.asp?Va" target="_blank">http://www.monsite.com/rss.asp?Va</a>
leurID="& id &"</guid>"
xml = xml &"<comments><a href="http://www.monsite.com/rss.as" target="_blank">http://www.monsite.com/rss.as</a>
p?ValeurID="& id &"</comments>"
xml = xml &"<description>
xml = xml & news &"</description></item>"
rs.movenext
Wend
xml = xml &"</channel></rss>"
Response.Write xml
rs.close
conn.close
%> |
Partager