Tsys _ rss Program

Source: Internet
Author: User
Tags format definition servervariables

Example address:

Http://www.18eden.com/rss.asp

Site: http://www.18eden.com/jiankang

Put the program in the root directory

You can also modify the address of another directory to read the latest 20 resources. (You can modify the address to read the get parameter)

Automatically identifies the website address port without manual intervention.Copy codeThe Code is as follows: <% Option explicit %>
<! -- # Include file = "Manage/Include/Config. do" -->
<%
Dim sSQL, rs, sCrLf, sXmlClear, sRssHead, sRssEnd, Url
SCrLf = chr (13) & chr (10) 'Carriage return + line feed
If Request. ServerVariables ("HTTPS") = "on" Then
URL = "https ://"
Else
URL = "http ://"
End If
Url = Url & Request. ServerVariables ("SERVER_NAME") & ":" & Request. ServerVariables ("SERVER_PORT ")
SXmlClear = "<? Xml version = '1. 0' encoding = 'gb2312 '?> "& SCrLf
'Srsshead = "<rdf: RDF xmlns: rdf = 'HTTP: // your xmlns: dc = 'HTTP: // purl.org/dc/elements/1.1/'xmlns: sy = 'HTTP: // your xmlns: admin = 'HTTP: // webns.net/mvcb/'xmlns = 'HTTP: // purl.org/rss/1.0/'>"
SRssHead = "<rss version = '2. 0'>" & sCrLf
SRssHead = sRssHead & "<channel>" & sCrLf
SRssHead = sRssHead & "<title>" & Def_MySiteTitle & "</title>" & sCrLf
SRssHead = sRssHead & "<description>" & def_effecitle & "</description>" & sCrLf
SRssHead = sRssHead & "<link>" & url & "</link>" & sCrLf
SRssHead = sRssHead & "<language> zh-cn </language>" & sCrLf
SRssHead = sRssHead & "<docs> News Center </docs>" & sCrLf
'Srsshead = sRssHead & "<dc: creator> Yezhan, okhtm@msn.com </dc: creator>" & sCrLf
SRssHead = sRssHead & "<generator> Rss Generator </generator> <items>" & sCrLf

SRssEnd = "</items> </channel> </rss>"

'Response. CharSet = "gb2312" 'Dataset
Response. ContentType = "text/xml" 'data stream format definition
Response. ContentType = "application/xml"
Response. Expires = 0
Response. write sXmlClear
Response. write sRssHead
Dim Conn
Set Conn = Server. CreateObject ("Adodb. Connection ")
Conn. Open ConnStr
Dim SQL
SQL = "select Top" & RssNewsList_PageSize & "Title, FilePath, AddTime, KeyWord, Content, Classtitle, EditorTitle From view_NewsInfo where Del = 0 Order By addTime DESC"
Set Rs = Server. CreateObject ("ADODB. RecordSet ")
Rs. open SQL, conn, 1, 2
If rs. eof and rs. BOF Then
Response. Write ("<item> </item> ")
Else
Do while not rs. eof
Response. Write ("<item>") & RS ("Title ")
Response. Write ("<title> <! [CDATA ["& Rs (" Title ") &"]> </title> ")
Response. Write ("<description> <! [CDATA ["& RS (" KeyWord ") &"]> ")
Response. Write ("<content> <! [CDATA ["& RS (" Content ") &"]> </content> ")
Response. Write ("<link>" & url & RS ("FilePath") & "</link> ")
Response. Write ("<subject>" & RS ("Classtitle") & "</subject> ")
Response. Write ("<creator>" & RS ("EditorTitle") & "</creator> ")
Response. Write ("<date>" & RS ("addtime") & "</date> ")
Response. Write ("</description> </item> ")
RS. MoveNext
Loop
End if
Rs. close
Set rs = nothing
Response. write sRssEnd
%>

Release the tsys modification method '''' for the minor version later '''

Http://www.im286.com/thread-1370996-1-1.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.