Author |
Topic  |
|
The Impact
Junior Member
 
Australia
398 Posts |
Posted - 18 October 2003 : 19:54:05
|
I noticed that there is an ASP page which generates the XML for a news feed on this forum.
I am interested in using this code for my forum. Would you be able to supply me with the code ?
Thankyou  |
|
dayve
Forum Moderator
    
USA
5820 Posts |
|
The Impact
Junior Member
 
Australia
398 Posts |
Posted - 18 October 2003 : 20:15:09
|
Thankyou very much !  |
Edited by - The Impact on 18 October 2003 20:15:41 |
 |
|
masterao
Senior Member
   
Sweden
1678 Posts |
|
The Impact
Junior Member
 
Australia
398 Posts |
Posted - 18 October 2003 : 20:33:56
|
Perfect, thankyou very much both of you !  |
 |
|
masterao
Senior Member
   
Sweden
1678 Posts |
|
The Impact
Junior Member
 
Australia
398 Posts |
Posted - 18 October 2003 : 21:16:38
|
I've decided to make a new RSS feed for my site's news but for some reason the page comes up like this http://v8impact.com/news/rss.asp in HTML.<%@ Language="VBScript" %>
<%
' ## Here we can connect to the database
ConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=MyDatabaseLocation"
Set Conn = Server.CreateObject("ADODB.Connection")
' ## Time to actually open the database connection
Conn.Open ConnString
' ## Write the XML header
XML = ""
XML = "<?xml version=""1.0"" encoding=""ISO-8859-1"" ?><rss version=""0.92""><channel>"
XML = XML & "<title>V8Impact Latest News</title>"
XML = XML & "<link>http://www.v8impact.com/news/</link>"
XML = XML & "<description>V8Impact Latest News</description>"
XML = XML & "<image>"
XML = XML & "<link>http://www.v8impact.com/news/</link>"
XML = XML & "<url>http://www.v8impact.com/images/v8impact_logo1.jpg</url>"
XML = XML & "<title>V8Impact Latest News</title>"
XML = XML & "</image>"
' ## Open recordset object
Set Rs = Server.CreateObject("ADODB.Recordset")
' ## Write the SQL needed for the page
StrQry = "SELECT N_ID, N_Title, N_Date, N_Blurb FROM News ORDER BY N_ID DESC;"
Rs.Open StrQry, Conn
' ## Start database loop
If Not Rs.EOF Then
For I = 1 to 5
XML = XML & "<item>"
XML = XML & "<title>" & Rs("N_Title") & "</title>"
XML = XML & "<link>http://www.v8impact.com/news/default.asp?article=" & Rs("N_ID") & "</link>"
XML = XML & "<description>Report posted on " & Rs("N_Date") & "...<br><br>" & Rs("N_Blurb") & "</description>"
XML = XML & "</item>"
Rs.Movenext
Next
End If
' ## Time to finish this page off
XML = XML & "</channel>"
XML = XML & "</rss>"
Response.Clear
Response.Expires = 0
Response.ContentType = "text/xml"
Response.Write XML
' ## Finish database object
Set Conn = Nothing
' ## Close the recordset
Set Rs = Nothing
' ## Say goodbye to the connection
%> Any idea what's wrong ? |
Edited by - The Impact on 18 October 2003 21:17:20 |
 |
|
RichardKinser
Snitz Forums Admin
    
USA
16655 Posts |
Posted - 18 October 2003 : 22:28:07
|
you need to convert & to & in your titles.
you can do that by changing this:
Rs("N_Title")
to this:
replace(Rs("N_Title"),"&","&") |
 |
|
The Impact
Junior Member
 
Australia
398 Posts |
Posted - 18 October 2003 : 22:44:15
|
I have done that and uploaded it but it still does not show up like an XML file. I'm sure that I'm missing something simple as this is my first time using XML. |
 |
|
dayve
Forum Moderator
    
USA
5820 Posts |
Posted - 18 October 2003 : 22:54:46
|
are you seeing the error that is produced?
End tag 'description' does not match the start tag 'br'. Error processing resource 'http://v8impact.com/news/rss.asp'. Line 1, Position 664
|
|
 |
|
dayve
Forum Moderator
    
USA
5820 Posts |
Posted - 18 October 2003 : 22:56:30
|
change this line:
XML = XML & "<description>Report posted on " & Rs("N_Date") & "...<br><br>" & Rs("N_Blurb") & "</description>"
to this:
XML = XML & "<description>Report posted on " & Rs("N_Date") & "...<br /><br />" & Rs("N_Blurb") & "</description>"
|
|
 |
|
The Impact
Junior Member
 
Australia
398 Posts |
Posted - 18 October 2003 : 23:07:39
|
I just re-opened the browser and it worked ! Thanks for everyone's help !  |
Edited by - The Impact on 18 October 2003 23:12:01 |
 |
|
RebelTech
Average Member
  
USA
613 Posts |
Posted - 18 October 2003 : 23:35:52
|
I didn't want to interupt till things got fixed. My question is asked out of naivete. I recently got a RSS parser up and I am grabbing feed into my site. I in no way have enough traffic to even dream about exporting my stuff. My question is: Do alot of folks pull in RSS from other's forums? Do you guys pull in feeds from specific sites to keep on top of a particular subject the way I hang out here trying learn about asp and Snitz? Just wonderin' |
 |
|
dayve
Forum Moderator
    
USA
5820 Posts |
Posted - 18 October 2003 : 23:49:07
|
I use Blog Syndications (same thing) for feeds to my reader, not so much for forums although I had Snitz in my list for awhile, but since I visit Snitz on a daily basis I saw no real need for having it on my reader. |
|
 |
|
|
Topic  |
|