Print Page | Close Window

RSS Into Database

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=5448
Printed Date: 31 March 2026 at 8:41am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: RSS Into Database
Posted By: rhysa
Subject: RSS Into Database
Date Posted: 02 September 2003 at 8:42am

Hi everyone,

I've starting playing with XML and I've seen some great examples to parse XML and RSS documents to display the headlines on a table. However, I'm stuck with something : I'd like to know how to insert the RSS items into a database.

I mean, most of the samples just take the RSS Newsfeed and parse it through an XSL to display it, but what I want to achieve is to take the <TITLE>, <LINK> and <DESCRIPTION> items from the newsfeed and insert them into a database table (title,link, description).

I'm really stuck  and I'm new here
Any help would be greatly appreaciated

Thanks!




Replies:
Posted By: MorningZ
Date Posted: 02 September 2003 at 11:45am

first off.. one of the purposes of RSS is to avoid database interaction

none the less.. all you would do it work through the XML document and instead of displaying it, build a SQL statement
http://forums.webwiz.net/forum_posts.asp?TID=5360&PN=1 - http://forums.webwiz.net/forum_posts.asp?TID=5360&PN=1



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: rhysa
Date Posted: 02 September 2003 at 12:36pm
Originally posted by MorningZ MorningZ wrote:

first off.. one of the purposes of RSS is to avoid database interaction

Yes, you are right.
But in this case, I need to save that information syndicated from an external source into a database.

I apprecaite your sample, however what it does is a transformation to display it directly on the web page.

What I'd really like to see is a sample that walks the RSS Newsfeed taking each of the required items (title, description and link) and placing it into variables (so that a sql statement could be built later)

This is the first time that I approach this technology (XML) and I'm not sure of how to achieve what I'm trying

 



Posted By: MorningZ
Date Posted: 02 September 2003 at 12:49pm

the link and sample i provided above has nothing to do with XML per se....

but as said in my reply (and echoed in the comment: "I apprecaite your sample, however what it does is a transformation to display it directly on the web page").. so instead of Response.Write-ing the value, then save it in a variable or something and build up a SQL statement to do the database insert.... no one says you have to display the data gathered from the RSS document, that sample above is more or less code to be able to parse/process the XML document, displaying it is just the end of the road for it....



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: rhysa
Date Posted: 02 September 2003 at 1:07pm

Dear MorningZ, thanks a lot for helping me :

Originally posted by MorningZ MorningZ wrote:

 instead of Response.Write-ing the value, then save it in a variable or something and build up a SQL statement to do the database insert

after looking at your code, there's only one response.write which displays the full HTML once the XML is transformed. It is not taking each element (which is what i want to achieve).

What I'm currently looking, is something like this :

  1. Open the XML document (URL)
  2. Get the ITEMS nodes
  3. Walk through the ITEMS nodes like this (Loop or for each) :
    link=Link from the current node
    title=title from the current node
    description=descriptionfrom the current node

If you see, I'm taking the document and just selecting it's ITEMS and then taking some of its subnodes (specifically link,title,description) and storing them on a variable.

I'm not sure if I'm being clear.
Thanks for your patience




Posted By: rhysa
Date Posted: 04 September 2003 at 3:50pm

Any suggestions?

I'm going crazy with this and I don't seem to find a working sample



Posted By: MorningZ
Date Posted: 04 September 2003 at 4:14pm

yeah, go learn the commands "selectNodes" and "selectSingleNode"

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk30/htm/xmmthselectnodes.asp - http://msdn.microsoft.com/library/default.asp?url=/library/e n-us/xmlsdk30/htm/xmmthselectnodes.asp

you seem to not have much interest in learning this yourself... not sure if you expect someone to code the whole thing for you



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: rhysa
Date Posted: 04 September 2003 at 4:39pm
Thanks for the harsh reply.
Rude but useful, I'll never ask anything here again



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net