Forums: Back End:

 

c# rss reader

first
 

Outshortyuk1 c# rss reader

Hey all. In my efforts to take up a new language i have given c# a go, so that i can progress to work with xaml once i have a solid foundation.

Anyway, onto the problem.

Im writing a "from scratch" rss reader. That means im not using the xml features in .net but have written a reader using simply a TextReader.

All is working fine (reads rss from sky and bbc fine). The problem occurs when i try and read rss feads from sites whos .xml files are not visible via a link(for example 12s - you dont have a rss.xml file or whatever to read from). This is because im using a WebClient Streamreader which requires a direct filepath.

Anyone have any ideas for a workaround. Feel free to ask any qs.

By the way, this is purely for my own personal learning - i know using a Text reader is very insecure as is half the things im doing. This is just for myself.

As happens sometimes a moment settled and hovered and remained for much more than a moment. And sound stopped and movement stopped for much, much more than a moment. And then the moment was gone. - Steinbeck.
quote
 

jamiec

Originally posted by: Outshortyuk1
That means im not using the xml features in .net but have written a reader using simply a TextReader.


Utter craziness. If I asked you to drive me to the shops would you set about building a car from the bits in your garage? At very least, you have an XmlTextReader which is used for fast forward-only reading.

As far as loading dynamic rss feeds (ie, those which use server side technology to output an xml stream rather than an actual xml file which you can download) this should make no difference whatsoever. Xml is xml is xml. It doesn't matter if you get it from an actual .xml file online or a .php that outputs xml.



 

Outshortyuk1

Originally posted by: jamiec
Originally posted by: Outshortyuk1
That means im not using the xml features in .net but have written a reader using simply a TextReader.


Utter craziness. If I asked you to drive me to the shops would you set about building a car from the bits in your garage? At very least, you have an XmlTextReader which is used for fast forward-only reading.

As far as loading dynamic rss feeds (ie, those which use server side technology to output an xml stream rather than an actual xml file which you can download) this should make no difference whatsoever. Xml is xml is xml. It doesn't matter if you get it from an actual .xml file online or a .php that outputs xml.



As is said this is just a learning aid for me - to get to grips with the basics of c#. Dont worry, i will have no hesitation of using xml readers etc later, this is just me playing around with the regular expression, text, file and other basic components in c# so i can see how the language works etc. I have never used a .net based language before (other than vb, but that was 4 years ago and nothing sophisticated at all - a calculator).

I wonder why the stream reader when pointing to a directory doesnt pick up the stream then...hmm. Thanks for the help anyway jamiec, tis appreciated.

ThumbsUp

As happens sometimes a moment settled and hovered and remained for much more than a moment. And sound stopped and movement stopped for much, much more than a moment. And then the moment was gone. - Steinbeck.
quote
 

jamiec

I understand the learning aspect, but seriously, rolling your own Xml functionality is a waste of time. Concentrate on learning how streams and webrequests work.

If you need some specific help then post ya code.

 

Outshortyuk1

Originally posted by: jamiec
I understand the learning aspect, but seriously, rolling your own Xml functionality is a waste of time. Concentrate on learning how streams and webrequests work.

If you need some specific help then post ya code.



Cheers smile Im gonna finish the one i started (to a point anyway) and start a new one now that im used to the basics of c# and such.

If i need any help il give you a shout. Cheers, for the help.

As happens sometimes a moment settled and hovered and remained for much more than a moment. And sound stopped and movement stopped for much, much more than a moment. And then the moment was gone. - Steinbeck.
quote
 

Outshortyuk1

As a follow up:

I have now re-written the entire thing using an xml text reader.

All is working nicely with most (there are a couple of hiccups) feeds out there.

I have stumbled upon and interesting problem, probably related to the earlier one.

Twelvestone is one of the remainin sites iam having trouble connecting to. When the xml stream goes to connect the responce given is "Application Error (Rails)". The streamreader seems to connect to the stream but this is all it recieves. any ideas anyone?

As happens sometimes a moment settled and hovered and remained for much more than a moment. And sound stopped and movement stopped for much, much more than a moment. And then the moment was gone. - Steinbeck.
quote
 

jamiec

I tried a few tests and I get exactly the same from 12s. It's returning a small fragment of HTML in response to a request:

<html><body><h1>Application error (Rails)</h1></body></html>

 

Outshortyuk1

Ahh well, least its not me then big grin.hehe. Cheers Jamiec.

As happens sometimes a moment settled and hovered and remained for much more than a moment. And sound stopped and movement stopped for much, much more than a moment. And then the moment was gone. - Steinbeck.
quote
 
first
 

Forums: Back End: c# rss reader

 
New Post
 
You must be logged in to post