{"id":97,"date":"2006-10-20T09:25:33","date_gmt":"2006-10-20T14:25:33","guid":{"rendered":"\/cgi\/wp\/?p=97"},"modified":"2006-10-20T09:25:33","modified_gmt":"2006-10-20T14:25:33","slug":"web-service-to-parse-rss-feed-for-data","status":"publish","type":"post","link":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/?p=97","title":{"rendered":"Web Service To Parse RSS Feed For Data"},"content":{"rendered":"<p>On Thursday I developed a web service to get the New York Lotto numbers. My web service is getting the numbers from a RSS feed because it is easier to parse XML than it is to find data in HTML source code.<\/p>\n<p>I reused the code from my Stickam ASPX page which uses the HttpWebRequest class of the System.Net namespace to make a request to a web server and get the response. I had the same problem with extra characters appearing at the end of the XML making it invalid so I fixed the StreamReader problem. Instead of reading a fixed number of bytes I read an entire line:<\/p>\n<p><code><br \/>\nDim Reader As StreamReader = New StreamReader(resp.GetResponseStream(), System.Text.Encoding.UTF8)<br \/>\nDim Writer As StringWriter = New StringWriter<\/p>\n<p>Dim strLine As String<br \/>\nDo While Reader.Peek() >= 0<br \/>\n&nbsp;&nbsp;strLine = Reader.ReadLine()<br \/>\n&nbsp;&nbsp;Writer.WriteLine(strLine)<br \/>\nLoop<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>On Thursday I developed a web service to get the New York Lotto numbers. My web service is getting the numbers from a RSS feed because it is easier to parse XML than it is to find data in HTML &hellip; <a href=\"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/?p=97\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=\/wp\/v2\/posts\/97"}],"collection":[{"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=97"}],"version-history":[{"count":0,"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=\/wp\/v2\/posts\/97\/revisions"}],"wp:attachment":[{"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=97"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=97"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/williamsportwebdeveloper.com\/cgi\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=97"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}