Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 RSS Agregator
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

vesse
New Member

United Kingdom
69 Posts

Posted - 11 February 2004 :  04:55:09  Show Profile  Visit vesse's Homepage  Send vesse an AOL message  Send vesse an ICQ Message
Has anyone considered building an RSS aggregator for Snitz forums that would list the 10 most recent posts and general stats and send it back to the user in RSS format?

Building Web Systems for a new Generation @ http://www.vdesign-studios.com
webmaster@vdesign-studios.com
rvesse@hotmail.com
rvesse@dhtmlshock.com

laser
Advanced Member

Australia
3859 Posts

Posted - 11 February 2004 :  04:57:08  Show Profile
Richard Kinser has already done this - a search for RSS here should find a few interesting topics, and the code you require.
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 11 February 2004 :  05:15:55  Show Profile
see here for an example:

http://forum.snitz.com/forum/rssfeed.asp

you can download it here:

http://www23.brinkster.com/richsnitz/rssfeed.zip (right-click and Choose "Save Target As...")
Go to Top of Page

Jeepaholic
Average Member

USA
697 Posts

Posted - 11 February 2004 :  14:59:51  Show Profile  Visit Jeepaholic's Homepage
Cool code, Richard.

Anybody have something built that could take an RSS feed and display it nicely?

Al Bsharah
Aholics.com

Jeepaholics Anonymous
Broncoholics Anonymous
Network Insight
Go to Top of Page

Astralis
Senior Member

USA
1218 Posts

Posted - 11 February 2004 :  15:38:25  Show Profile  Send Astralis a Yahoo! Message
On a website or desktop?
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 11 February 2004 :  16:00:20  Show Profile
Jeep, Trillian has an RSS plugin, and I used something off SourceForge for a while but the name escapes me now Their icon was a cube.
Go to Top of Page

Jeepaholic
Average Member

USA
697 Posts

Posted - 11 February 2004 :  16:37:08  Show Profile  Visit Jeepaholic's Homepage
Astralis / Laser

Looking for some ASP code that would read the XML file and display it in on a web page...that's all.

Al Bsharah
Aholics.com

Jeepaholics Anonymous
Broncoholics Anonymous
Network Insight
Go to Top of Page

Astralis
Senior Member

USA
1218 Posts

Posted - 11 February 2004 :  16:42:51  Show Profile  Send Astralis a Yahoo! Message
Laser's recommendations, I believe, will only work for your desktop.

Displaying XML on a website is fairly easy, though. I found some code on ASPIN and I use it to display RSS feeds from a variety of sites. The code I use works 90 percent of the time but the problem is you cannot control what code is produced in the RSS feed. So, if the RSS feed you're reading from isn't well-formatted, you may get errors.

If you can't find any samples that you recognize on ASPIN, I can post my code that reads the RSS info from a database and then fetches it from a website and displays it on my site.
Go to Top of Page

Jeepaholic
Average Member

USA
697 Posts

Posted - 11 February 2004 :  21:25:19  Show Profile  Visit Jeepaholic's Homepage
Man, I just tried about four different scripts. None of them are working. Here's an example of one, which, I would expect to work but doesn't...

news.asp

<%
Function URLNewsItem(NewsURL)
	
	Dim objHTTP
	Dim objXML
	Dim objXSL
	Dim HowMany
	Dim XMLNews
	
	set objHTTP = Server.CreateObject("Microsoft.XMLHTTP")
	objHTTP.open "GET", "" & NewsURL & "", false
	objHTTP.send
	
	set objXML = objHTTP.responseXML
	
	set objXSL=Server.CreateObject("microsoft.xmldom")
	objXSL.async=false
	
	objXSL.load(Server.MapPath("news.xsl"))
	
	if (objXSL.readyState = 4 AND objXSL.parseError.errorCode = 0) then
	
	  HowMany = CountOccurances(objXML.transformnode(objXSL), "<tr>")

	  
		 if (isnull(HowMany) or (HowMany ="")) then
		Response.Write "Sorry, no headlines available at present!<br>"
	  else
		URLNewsItem = (XMLNews)
	  end if
	
	else
	  Response.Write "Error: " & objXSL.parseError.reason & "<br> URL:" & objXSL.url
	end if

End Function

%>

<%
response.write URLNewsItem("http://www.bbc.co.uk/syndication/feeds/news/ukfs_news/uk/rss091.xml")
%>


news.xsl

<?xml version="1.0" encoding="ISO-8859-1" ?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="ISO-8859-1" omit-xml-declaration="yes" indent="yes" />

<xsl:template match="*">
<table border="0">
<tbody>
<tr><td class="title" width="200" bgcolor="#FFFFFF" height="22"><img src="linkarrow.gif" /><b>
<a class="title">
<xsl:attribute name="href">
<xsl:value-of select="*[local-name()='channel']/*[local-name()='link']" />
</xsl:attribute>
<xsl:attribute name="target">
<xsl:text>top</xsl:text>
</xsl:attribute>
<xsl:value-of select="*[local-name()='channel']/*[local-name()='title']" />
</a></b>
</td></tr>

<tr><td valign="top" class="headlines" width="200">
<xsl:for-each select="//*[local-name()='item']">
<xsl:if test="position() < 10">
<img src="linkarrow.gif" />
<a>
<xsl:attribute name="href">
<xsl:value-of select="*[local-name()='link']" />
</xsl:attribute>
<xsl:attribute name="target">
<xsl:text>top</xsl:text>
</xsl:attribute>
<xsl:value-of select="*[local-name()='title']" />
</a>
<br />
</xsl:if>
</xsl:for-each>
</td></tr>
</tbody>
</table>
</xsl:template>

<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>

</xsl:stylesheet>


I get a "Page Cannot Be Displayed" trying to access the news.asp file.
http://www.jeepaholics.com/rss/news.asp

The XML URL included in news.asp seems to have content:
http://www.bbc.co.uk/syndication/feeds/news/ukfs_news/uk/rss091.xml

<shrug> Thoughts?

Al Bsharah
Aholics.com

Jeepaholics Anonymous
Broncoholics Anonymous
Network Insight
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 11 February 2004 :  22:23:49  Show Profile
this is the error I see:

Microsoft VBScript runtime error '800a000d'

Type mismatch: 'CountOccurances'

/rss/news.asp, line 23
Go to Top of Page

Jeepaholic
Average Member

USA
697 Posts

Posted - 12 February 2004 :  00:05:51  Show Profile  Visit Jeepaholic's Homepage
Huh, why can't I get the cool error messages?! <laughing>

Is CountOccrances even an ASP function? Looking at it more, I'm not even sure what XMLNews is?! It's never defined, as far as I can see.

I found this one:
http://www.kattanweb.com/webdev/projects/index.asp?ID=7
...which seems to be pretty nice from a theoretical standpoint, but can only get a live Yahoo News RSS feed to display...none of my own (not even their own sample write_rss.asp one works! Then, I tried copying the source of the Yahoo News RSS feed onto my server, naming it yahoonews.xml...then loading that one, but it doesn't work! This is beginning to make a whole lot of no sense to me.

Anyone having any better luck?

Al Bsharah
Aholics.com

Jeepaholics Anonymous
Broncoholics Anonymous
Network Insight
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 12 February 2004 :  00:08:12  Show Profile
quote:
Originally posted by Jeepaholic

Huh, why can't I get the cool error messages?! <laughing>
http://www.morningz.com/mz/crystal/quick/friendly/friendly.asp
quote:
Originally posted by Jeepaholic

Is CountOccrances even an ASP function? Looking at it more, I'm not even sure what XMLNews is?! It's never defined, as far as I can see.
looks like CountOccurances is a function that should be defined somewhere.

found a CountOccurances function at this site:

http://www.purplepages.ie/site/articles/print.asp?faq=6&fldAuto=70
Go to Top of Page

OneWayMule
Dev. Team Member & Support Moderator

Austria
4969 Posts

Posted - 12 February 2004 :  00:27:29  Show Profile  Visit OneWayMule's Homepage  Send OneWayMule an ICQ Message
quote:
Originally posted by Jeepaholic

Astralis / Laser

Looking for some ASP code that would read the XML file and display it in on a web page...that's all.


I have done something like that for a course at the University... I'll dig up the code.

Richard, one question: since the Last Post Author is already in the description, wouldn't it make more sense to include the Topic Author in the title instead of the Last Post Author?

My MODs:
Birthdays - Custom Policy - F.A.Q. Administration - Forum Rules - Guestbook
Links Manager - MyOwnGoogle - Profile Views - Search Log - WebSearch

Useful stuff:
Forum and MOD Installation - MOD Installation Guide - Snitz v3.4.05 Readme - Free ASP Hosts - Support Snitz
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 12 February 2004 :  00:44:21  Show Profile
quote:
Originally posted by Jeepaholic
Anyone having any better luck?
here is the result using your files above (kinda):

http://www23.brinkster.com/richsnitz/news.asp

you can just remove the lines that refer to the CountOccurances function since it's not going to be used.

here is the contents of the news.asp file:
<%
Function URLNewsItem(NewsURL)
	dim objHTTP
	dim objXML
	dim objXSL

	set objHTTP = Server.CreateObject("Microsoft.XMLHTTP")

	objHTTP.open "GET", NewsURL, false
	objHTTP.send

	set objXML = objHTTP.responseXML

	set objXSL=Server.CreateObject("microsoft.xmldom")
	objXSL.async=false

	objXSL.load(Server.MapPath("news.xsl"))

	if (objXSL.readyState = 4 AND objXSL.parseError.errorCode = 0) then
		Response.Write(objXML.transformnode(objXSL))
	else
		Response.Write "Error: " & objXSL.parseError.reason & "<br> URL:" & objXSL.url
	end if
end function

URLNewsItem("http://forum.snitz.com/forum/rssfeed.asp")
%>


and I had to make 1 change to your xsl file:

change this line:
<xsl:if test="position() < 10">
to this:
<xsl:if test="position() &lt; 10">

Go to Top of Page

Jeepaholic
Average Member

USA
697 Posts

Posted - 12 February 2004 :  01:18:28  Show Profile  Visit Jeepaholic's Homepage
Ok, so get this...

While using this feed:
http://forum.snitz.com/forum/rssfeed.asp

I get this response:
http://www.jeepaholics.com/rss/richardsnitz.asp

While using this feed:
http://www.jeepaholics.com/support/rssfeed.asp

I get this response:
http://www.jeepaholics.com/rss/richardjeep.asp

Any ideas?
<-- Going Crazy

EDIT> Line 10 is this:
objHTTP.send

AL

P.S. Thanks for the help thus far!)

Al Bsharah
Aholics.com

Jeepaholics Anonymous
Broncoholics Anonymous
Network Insight

Edited by - Jeepaholic on 12 February 2004 01:20:31
Go to Top of Page

Jeepaholic
Average Member

USA
697 Posts

Posted - 12 February 2004 :  01:31:36  Show Profile  Visit Jeepaholic's Homepage
BAH. Nevermind. I just figured something out...I've got DNS issues (on the inside). Long time bug with my NAT setup, argh. Nevermind. <laughing>

I wonder how many of these other scripts would have worked? Thanks for the help, sorry for the stupidity. GRR.

Al Bsharah
Aholics.com

Jeepaholics Anonymous
Broncoholics Anonymous
Network Insight
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.23 seconds. Powered By: Snitz Forums 2000 Version 3.4.07