Okay, here's the situation: I'm in the process of creating a brand spanking new Intranet site for the hospital I work for and want to include Health and Healthcare news stories from the AP. The problem is that 3/4 of the pc's in the hospital do not have access to the outside world, only the internal network, unless you sign on to the proxy. Most of the people who will want to read the news stories will not have authorization to sign on to the Internet and will not be able to read the story if I just use an RSS feed and link it up. Is there a way, using classic ASP, to pull the page down from the AP web site with the Intranet server and then display it on the client browser? I don't want to "rip" the story off the page, I want to be able to display the entire page, but using the Intranet server as a proxy. Does this make any sense?
I'm taking a shot in the dark here... Could you just not "Server.Execute()" or the external pages on your sever, hosting the result in a page to which users have access? Other than could you write a service on the server to poll the AP and save pages via XmlTranslation.....
Have the main computer run as a IIS Server then as heppath said, write the server.execute on that server. Then have the other computers access the main computer like http://127.0.0.1/read.aspx?idstory=208
Unfortunetely the Server.Execute method wouldn't work for what I'm trying to do. I ended up writing the following script: Code: <% thisURL = request.QueryString("urlPath") Set GetConnection = CreateObject("Microsoft.XMLHTTP") GetConnection.Open "get", thisURL, False GetConnection.Send ResponsePage = GetConnection.responseText Response.write (ResponsePage) Set GetConnection = Nothing %> and it's working 95% perfect. Instead of using the AP, I'm going to use WebMD as they have a cleaner layout and if you use "printing=true" as a url variable, you get a printing layout. The last problem that I'm running into is that the pages that I'm pulling have funky stuff going on before the BODY tag and it's messing up my page layout. If I can figure out a way to eliminate everything but what's in the BODY tag, it will be perfect.
I don't see how Server.Execute would not work You have IIS on the main computer. Your script is there. Server.execue is executing relative paths... Now if the webpages are on a different computer, then server.execute wouldnt work The XMLHTTP object would work too but I hate creating Server side objects
Just have to parse the response... The response should have a 'text' property on it.. so.... 1. locate position of the string "<BODY>" 2. locate position of the string "</BODY>" Create a string from within those positions?
That's exactly the problem. Essentially I guess I wanted to "screen scrape" the remote page, but not be back-handed about it. I wanted to keep the links in tact, any copyrights and text ads there as not to presume the article as my own. I actually was able to figure it out. Tool a little bit of doing, but here's what I came up with: Code: <% srvXmlHttp.open "GET", URL, false srvXmlHttp.send() if srvXmlHttp.status = 200 Then result = srvXmlHttp.responseText beginpos =Instr(result,"<SPAN class=article-title>") result = replace(Mid(result,beginpos,len(result)), "/content", "http://my.webmd.com/content") result = replace(result, "Original page:", "<center><font size=""-1"">Original page:") result = replace(result, "<td width=""50%"" valign=""top"">", "<td width=50% valign=top align=right>") result = replace(result, "width=""80%""", "width=""99%""") result = replace(result, "<SPAN class=article-title>", "<SPAN class=article-title><center>") result = replace(result, "<SPAN class=small-black-headline>", "<SPAN class=small-black-headline><center>") result = replace(result, "</SPAN><p></p>", "</center></SPAN>") result = replace(result, "<span class=article-byline>By", "<br><br><span class=article-byline>By") result = replace(result, "<SPAN class=article-byline>Reviewed", "<br><br><SPAN class=article-byline>Reviewed") result = replace(result, "<SPAN class=credits>©", "<SPAN class=credits>Story ©") endpos = Instr(result,"All rights reserved.") result = Mid(result,1,endpos+19) response.Write result end if Set srvXMLHttp=Nothing %> By using the multiple REPLACE statements, I was able to lay it out to work with my design, plus preserve the links and copyrights from WebMD while eliminating any fancy page layout..