Jump to content

rss backup


paulnordstrom

Recommended Posts

Hello everyone - I'm new here so quick background: Im experienced in vbscript, asp and msSQL, however I have never worked with xml or rss before, so that being said i have a question that i think might be sort of traight forward, but...Is there any way to write a backup of a rss feed to a sql database? Real time? Like if you just wanted to log news stories/title/date as they happened...or would you have to have some constantly reloading page that looks for story title that are new?Is there some built in function of SQL to connect to an rss feed?Thanks a lot ,Paul

Link to comment
Share on other sites

I would imagine that you would have to, at the very least, create some sort of scheduled task to load the page and create an SQL script in insert/update your database from the XML/RSS.I know MS SQL 2005 can parse XML directly, but I am not sure if that alone can trigger the request for the file/feed. If it could - then its all in the DB server. If not, then you'd have to create an ASP page to request the XML/RSS, parse it into a query, then insert/update conditioned accordingly.In conditioning, I mean, are you going to write the ASP to only get today's RSS dated information and then only run the scheduled task once a day? Or, are you going to run the scheuled task multiple times a day and truncate your table each time.With the first, you get the benefit of historical data - regardless of your source including it but then only get updates once a day (bad if updates are frequent). With the second, you get the benefits of the most updated information (depending on the frequency of the scheduled task) but your constantly truncating and inserting an entire feed and only ever retaining what is supplied in the feed - no historical information.Hope that helps.Oh, and by the way - WELCOME! :)

Link to comment
Share on other sites

Thank you very much - thats kind of what I was thinking had to happen. The thing is I need the backups as soon as they are posted, so I woud probably load the page every minute, loop, and just SELECT * WHERE NOT(NAME = xmlName) or something like that. Im going to check on connectionstrings.com to figure out out to use xml as a datasource.Thanks again, and any other insights would be much appreciated,Paul

Link to comment
Share on other sites

A couple more things:a.) if you figure out a way to do this all in SQL2005, please let me know - it will be handy informationb.) you might take a deeper look at the RSS feed and find out if their publish date is recreated when the feed is requested or is true to the last update.. If it is the latter, then I would suggest creating a page that checks that date with the last date in the DB to save you the processing time and effort of perofrming all your inserts/updates.I'll post back if I thin of anything else.

Link to comment
Share on other sites

Just a thought.... if that feed is a local feed (that is, one that you have control over when it's posting), can't you simply put the backup commands in the scripts that submits the RSS feed? That way, the backup script will be executed every time a data is posted.If we're talking about remote feeds, then I guess you really have to periodically check those sites for updates. That's how Yahoo! and everyone is doing it and I'm not seeing anothe way either.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...