XML [ClassicASP] DAUM(다음) 뉴스검색제휴 xml 파일 만들기
페이지 정보
본문
*.xml 파일 만들기는 https://www.happyjung.com/lecture/1424 를 보세요
DAUM(다음) 뉴스검색제휴 xml 파일 만들기
송고 기사 URL : https://www.happyjung.com/view.asp?seq=5083
송고기사 XML URL : https://www.happyjung.com/view_xml.asp?seq=5083&channel=book
<!--#include virtual="/db_connection.asp"-->
<% Response.ContentType = "application/xml; charset=utf-8" %>
<%
Session.CodePage = 65001
dim seq : seq = request("seq")
Sql = "select * from board where seq= '"& seq &"'"
'response.write Sql&"<br>"
Set Rs = Con.Execute(Sql)
Dim BD_NAME : BD_NAME = Rs("BD_NAME")
Dim email : email = Rs("email")
Dim subject : subject = Rs("subject")
Dim content : content = Rs("content")
Dim InputDate : InputDate = DateValue(Rs("BD_INPUTDATE"))
Dim InputTime : InputTime = right(Rs("BD_INPUTDATE"), 8)
'response.write INPUTDATE &"<br>"
Dim GetBD_FROM : GetBD_FROM = Rs("BD_FROM")
Dim InputDate1 : InputDate1 = left(InputDate,4) & mid(InputDate,6,2) & right(InputDate,2)
'response.write INPUTDATE1
Dim InputDate2 : InputDate2 = split(InputTime,":")
'response.write int(InputDate2(0)) & InputDate2(1) & InputDate2(2)
Dim Getdate4 : Getdate4 = mid(INPUTDATE,12,4)
if Getdate4 = "오전" then
if int(InputDate2(0)) < 10 then
GetTime3 = "0" & int(InputDate2(0)) & InputDate2(1) & InputDate2(2)
end if
else
GetTime3 = (int(InputDate2(0)) + 12) & InputDate2(1) & InputDate2(2)
end if
'response.write INPUTDATE1 & GetTime3&"<br>"
Rs.close
%><?xml version="1.0" encoding="utf-8"?>
<NEWS ver="1.1" act="C" orgid="">
<DATETIME><% response.write INPUTDATE1 & GetTime3 %></DATETIME>
<WRITER_LIST>
<WRITER>
<NAME><![CDATA[<% response.write BD_NAME %>]]></NAME>
<EMAIL><% response.write email %></EMAIL>
</WRITER>
</WRITER_LIST>
<CATEGORY_LIST>
<CODE>soccer</CODE>
</CATEGORY_LIST>
<TITLE><![CDATA[<% response.write subject %>]]></TITLE>
<TEXT>
<![CDATA[<% response.write content %>]]>
</TEXT>
<EXT>
<OUTLINK><![CDATA[https://www.happyjung.com/view.asp?seq=<%=seq%>]]></OUTLINK>
<COPYRIGHT><![CDATA[<% response.write GetBD_FROM %>]]></COPYRIGHT>
</EXT>
</NEWS>
DAUM(다음) 뉴스검색제휴 xml 파일 만들기
송고 기사 URL : https://www.happyjung.com/view.asp?seq=5083
송고기사 XML URL : https://www.happyjung.com/view_xml.asp?seq=5083&channel=book
<!--#include virtual="/db_connection.asp"-->
<% Response.ContentType = "application/xml; charset=utf-8" %>
<%
Session.CodePage = 65001
dim seq : seq = request("seq")
Sql = "select * from board where seq= '"& seq &"'"
'response.write Sql&"<br>"
Set Rs = Con.Execute(Sql)
Dim BD_NAME : BD_NAME = Rs("BD_NAME")
Dim email : email = Rs("email")
Dim subject : subject = Rs("subject")
Dim content : content = Rs("content")
Dim InputDate : InputDate = DateValue(Rs("BD_INPUTDATE"))
Dim InputTime : InputTime = right(Rs("BD_INPUTDATE"), 8)
'response.write INPUTDATE &"<br>"
Dim GetBD_FROM : GetBD_FROM = Rs("BD_FROM")
Dim InputDate1 : InputDate1 = left(InputDate,4) & mid(InputDate,6,2) & right(InputDate,2)
'response.write INPUTDATE1
Dim InputDate2 : InputDate2 = split(InputTime,":")
'response.write int(InputDate2(0)) & InputDate2(1) & InputDate2(2)
Dim Getdate4 : Getdate4 = mid(INPUTDATE,12,4)
if Getdate4 = "오전" then
if int(InputDate2(0)) < 10 then
GetTime3 = "0" & int(InputDate2(0)) & InputDate2(1) & InputDate2(2)
end if
else
GetTime3 = (int(InputDate2(0)) + 12) & InputDate2(1) & InputDate2(2)
end if
'response.write INPUTDATE1 & GetTime3&"<br>"
Rs.close
%><?xml version="1.0" encoding="utf-8"?>
<NEWS ver="1.1" act="C" orgid="">
<DATETIME><% response.write INPUTDATE1 & GetTime3 %></DATETIME>
<WRITER_LIST>
<WRITER>
<NAME><![CDATA[<% response.write BD_NAME %>]]></NAME>
<EMAIL><% response.write email %></EMAIL>
</WRITER>
</WRITER_LIST>
<CATEGORY_LIST>
<CODE>soccer</CODE>
</CATEGORY_LIST>
<TITLE><![CDATA[<% response.write subject %>]]></TITLE>
<TEXT>
<![CDATA[<% response.write content %>]]>
</TEXT>
<EXT>
<OUTLINK><![CDATA[https://www.happyjung.com/view.asp?seq=<%=seq%>]]></OUTLINK>
<COPYRIGHT><![CDATA[<% response.write GetBD_FROM %>]]></COPYRIGHT>
</EXT>
</NEWS>
댓글목록
등록된 댓글이 없습니다.