{"id":50894,"date":"2002-12-17T07:03:16","date_gmt":"2002-12-17T07:03:16","guid":{"rendered":"http:\/\/www.soulhuntre.com\/items\/date\/2002\/12\/17\/added-some-database-stuff\/"},"modified":"2002-12-17T07:03:16","modified_gmt":"2002-12-17T07:03:16","slug":"added-some-database-stuff-2","status":"publish","type":"post","link":"http:\/\/legacyiamsenseiken.local\/2002\/12\/17\/added-some-database-stuff-2\/","title":{"rendered":"Added some database stuff\u2026"},"content":{"rendered":"

What’s up?<\/p>\n

Well, I’ve been working hard on some technical stuff. Tonight I took some
\ntime to get a handle on a nagging database problem that has been causing me
\nfits, the result is the cool and happening stuff on the side of the
\nweblog.soulhuntre.com<\/a> page that tells
\nyou what I am reading and so on. This turned out to be not only a database
\nissue, but a good excursion into
\n
ASP.NET<\/a> remote HTML
\ninclusion. I wound up making a user control that does it, and I’m sticking the
\ncode at the bottom of this entry, if you don’t see it try the [more] link.<\/p>\n

Lots of other stuff happening, but I am going to sleep.<\/p>\n

<\/p>\n

This is "scrape.ascx" – the custom control that will grab a web page and
\noutput it<\/u>…<\/p>\n

\n
<%@ Import Namespace="System.Net" %>\n<%@ Import Namespace="System.IO" %>\n\n<script language="C#" runat="server">\n\n\tpublic String url = "";\n\n\n\tvoid Page_Load(Object Src, EventArgs E) {\n      scrape_internal.Text = readHtmlPage(url);\n   \t}\n\n   \tprivate String readHtmlPage(string url)\n   \t{\n      String result;\n      WebResponse objResponse;\n      WebRequest objRequest = System.Net.HttpWebRequest.Create(url);\n      objResponse = objRequest.GetResponse();\n      using (StreamReader sr =\n         new StreamReader(objResponse.GetResponseStream()) )\n      {\n         result = sr.ReadToEnd();\n         \/\/ Close and clean up the StreamReader\n         sr.Close();\n      }\n      return result;\n   \t}\n\n<\/script>\n\n<asp:literal id="scrape_internal" runat="server"  \/><\/pre>\n<\/blockquote>\n

Here are some snippets of code to show you how to use it in a page<\/u>…<\/p>\n

\n

( before the <html> tag) <\/i><\/p>\n

<%@ Register TagPrefix="wsc" TagName="indications" SRC="\/_someplace_\/modules\/scrape.ascx" %><\/pre>\n

( somewhere in the body of the page )<\/i><\/p>\n

<wsc:indications id="wsc_indications" runat="server"\n\turl="\/network\/export\/indications.aspx" \/><\/pre>\n<\/blockquote>\n

Anyway, enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"

What’s up? Well, I’ve been working hard on some technical stuff. Tonight I took some time to get a handle on a nagging database problem that has been causing me fits, the result is the cool and happening stuff on the side of the weblog.soulhuntre.com page that tells you what I am reading and so […]<\/p>\n","protected":false},"author":3,"featured_media":53207,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"aside","meta":{"footnotes":""},"categories":[278],"tags":[],"_links":{"self":[{"href":"http:\/\/legacyiamsenseiken.local\/wp-json\/wp\/v2\/posts\/50894"}],"collection":[{"href":"http:\/\/legacyiamsenseiken.local\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/legacyiamsenseiken.local\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/legacyiamsenseiken.local\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/legacyiamsenseiken.local\/wp-json\/wp\/v2\/comments?post=50894"}],"version-history":[{"count":0,"href":"http:\/\/legacyiamsenseiken.local\/wp-json\/wp\/v2\/posts\/50894\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/legacyiamsenseiken.local\/wp-json\/wp\/v2\/media\/53207"}],"wp:attachment":[{"href":"http:\/\/legacyiamsenseiken.local\/wp-json\/wp\/v2\/media?parent=50894"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/legacyiamsenseiken.local\/wp-json\/wp\/v2\/categories?post=50894"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/legacyiamsenseiken.local\/wp-json\/wp\/v2\/tags?post=50894"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}