본 친구는 처음으로 외부 또는 외부에서 전송 될 수 있습니다. 내가 쓸 때 가능한 한 간단합니다.
웹 사이트, 블로그 등에 RSS 집계 기능을 추가하고 이제 Rss.asp의 중합 코드를 제공하여 응답 방법을 확인하십시오.
http://www.nbpda.com/rss.asp의 모습을 디버그하고 보여주는 것이 편리합니다.
테스트 후 대부분의 집계 독자를 지원하십시오
다음 코드는 rss.asp로 저장됩니다
다음은 코드 조각입니다.
다음은 코드 조각입니다. <!-#포함 파일 = "conn.asp"-> <% strurl = "http : //"& request.servervariables ( "server_name") & _ left (request.servervariables ( "script_name"), len (request.servervaribles ( "script_name"))-len ( "/rss.asp") // 파일 이름의 이름입니다. SQL = "ID DESC의 [테이블 이름] 주문에서 상위 100 * 선택을 선택하십시오."// 실제 수정에 따르면 상위 100 개는 최신 100 개 항목이며 직접 수정하며 동시에 쿼리 조건을 추가 할 수 있습니다. 여기서 xxx = 1 .... set rs = server.createobject ( "adodb.oldset") Rs.OOPEN SQL, CONN, 1,1 응답 .ContentType = "Text/XML" response.write "<? xml version =" "1.0" "encoding ="gb2312 ""?> "& vbcrlf response.write "<rss version =" "2.0" "" ">"& vbcrlf response.write "<channel>"& vbcrf response.write "<title> xxx.com RSS Feed </title>"& vbcrlf response.write "<link>"& strurl & "</link>"& vbcrip response.write "<language> zh-cn </language>"& vbcrlf response.write "<copyright> xxx.comcopyright>에 대한 RSS 피드"& vbcrlf rs.eof는 아닙니다 응답. "<tem>"& vbcrlf response.write "<title> <! [" ""& rs ( "title") & "] >> </title>"& vbcrlf response.write "<link>"& Strurl & "/xxxx.asp? id ="& rs ( "id") & "</link>"& vblockff response.write "<description> <! [" "" ""& rs ( "테마 필드") & "<br />"& rs ( "Content Field") & "<br /<br />]> < /description> "& vbcrf response.write "<pubdate>"& return_rfc822_date (rs ( "Time Field"), "gmt") & "</pubdate>"& vbcrlfff 응답. "</item>"& vbcrf rs.movenext 향하게 하다 response.write "</channel>"& vbcrlf 응답. "</rss>"& vbcrlf Rs.Close RS = 아무것도 설정하지 않습니다 함수 return_rfc822_date (byval mydate, byval timezone) Dim Myday, Mydays, Mymonth, Myyear 희미한 myhours, myminutes, myseconds mydate = cdate (mydate) myday = enweekdayname (mydate) MyDays = Right ( "00"& Day (MyDate), 2) mymonth = enmonthname (mydate) myyear = Year (mydate) myhours = right ( "00"& Hour (mydate), 2) myminutes = right ( "00"& minute (mydate), 2) myseconds = right ( "00"& second (mydate), 2) return_rfc822_date = myday & ","& _ Mydays & ""& _ Mymonth & "& _ Myyear & ""& _ Myhouse & ":"& _ Myminutes & ":"& _ myseconds & ""& _ "" "& 시간대 엔드 기능 함수 enweekdayName (inputDate) 희미한 결과 주중 사례를 선택하십시오 (InputDate, 1) 사례 1 : 결과 = "태양" 사례 2 : 결과 = "월" 사례 3 : 결과 = "tue" 사례 4 : 결과 = "수 사례 5 : 결과 = "thu" 사례 6 : 결과 = "Fri" 사례 7 : 결과 = "SAT" 종료 선택 enweekdayName = 결과 엔드 기능 함수 enmonthname (inputDate) 희미한 결과 사례의 달 (입력) 선택 사례 1 : 결과 = "Jan" 사례 2 : 결과 = "Feb" 사례 3 : 결과 = "mar" 사례 4 : 결과 = "apr" 사례 5 : 결과 = "5 월" 사례 6 : 결과 = "jun" 사례 7 : 결과 = "7 월" 사례 8 : 결과 = "8 월" 사례 9 : 결과 = "sep" 사례 10 : 결과 = "OCT" 사례 11 : 결과 = "NOV" 사례 12 : 결과 = "12 월" 종료 선택 enmonthname = 결과입니다 엔드 기능 %> |