We have a client that has purchased some syndicated content which they want to inclue within thier site. The content are coldfusion dynamic pages. I need a way to get these pages into the clients current layout. However there are a number of issues beyond my control which are making this task about 20x more difficult than it should be:
1.) The external content needs to be styled to match the client's site. Normally a provider would allow for this and have some kind of configuration or content management thing, but this one dosent, at least not to change the few things i need to change. The content has an inline style sheet that i need to change or nix all together so i can apply mine.
2.) The person who built the site initially unfortunately used a table based layout so in order to just use a frameset id have to recode nearly all the layouts, about 40 individual pages. However, even the framset wouldn negate issue 1.
3.) The clients server dosent run PHP or ColdFusion ASP.Net (the 3 languages which im novice to inermediate with) but does support ASP classic which ive never really looked at...
So initially my thought was to use some kind of include to drop the external page into our layout template, but im ver sure i cant include an external file with ASP classic, and now that i think of it im not sure if you can do this with CF or PHP as ive only ever used included files that were on the server of the calling page. Furthermore, and iFrame, while workable, isnt really desireable because id need to scroll the content and a second scroll bar is not acceptable.
After some research i thought maybe I had foufn an answer of sorts perhaps using XMLHttpRequest to get the document and store it as a string (or if it ended up being wel formed, as xml), then modify the code between <style></style> with my style rules . However the documentation at Devmo says that for security reasons you can call an external page.
what i need at this point is a nod in the right direction of how to accomplish this using ASP Classic and/or JS, or a simple indication that, "hey, its just not possible".
Any thoughts?
1.) The external content needs to be styled to match the client's site. Normally a provider would allow for this and have some kind of configuration or content management thing, but this one dosent, at least not to change the few things i need to change. The content has an inline style sheet that i need to change or nix all together so i can apply mine.
2.) The person who built the site initially unfortunately used a table based layout so in order to just use a frameset id have to recode nearly all the layouts, about 40 individual pages. However, even the framset wouldn negate issue 1.
3.) The clients server dosent run PHP or ColdFusion ASP.Net (the 3 languages which im novice to inermediate with) but does support ASP classic which ive never really looked at...
So initially my thought was to use some kind of include to drop the external page into our layout template, but im ver sure i cant include an external file with ASP classic, and now that i think of it im not sure if you can do this with CF or PHP as ive only ever used included files that were on the server of the calling page. Furthermore, and iFrame, while workable, isnt really desireable because id need to scroll the content and a second scroll bar is not acceptable.
After some research i thought maybe I had foufn an answer of sorts perhaps using XMLHttpRequest to get the document and store it as a string (or if it ended up being wel formed, as xml), then modify the code between <style></style> with my style rules . However the documentation at Devmo says that for security reasons you can call an external page.
what i need at this point is a nod in the right direction of how to accomplish this using ASP Classic and/or JS, or a simple indication that, "hey, its just not possible".
Any thoughts?
-
Re: Get an external URL's content, remove the styles, add my styles?
Fri, October 7, 2005 - 1:17 PMWhat you want to do is definitly possible though it will certinly take some work.
I used classic ASP for years and although I don't remember syntax, it IS possible to include other pages, although I don't think it was clean, it did work. The more that I think about I seem to remember a site I worked on that was nothing but a whole collection of includes in kind of a "web parts" configuraion.
Using XmlHttpRequest and modifying the string is probably the best bet. Developing that should be easier and more stable. -
-
Re: Get an external URL's content, remove the styles, add my styles?
Fri, October 7, 2005 - 1:46 PMThat works for me... i pretty much know howi was goign to approach it from the route after i read abotu the method, but i though i couldnt get pages from a 3rd party server, ie. i couldnt have the calling page, "www.clientsdomain.com/callpage.asp" use XmlHttpRequest to get "www.providersdomain.com/page.cfm ... which is what lead to these posts... hehe
Isthis limitation true or not? -
-
Re: Get an external URL's content, remove the styles, add my styles?
Mon, March 20, 2006 - 3:10 PMI was recently tasked with designing a solution that needs to make a server-to-server HTTP request to get some value returned by a remote web server. Initially, I was considering an AJAX approach, but indeed, the XmlHttpRequest can only fetch content from the originating server - mostly for security reasons.
Classic ASP has a built-in object XMLHTTP that will enable you to make an HTTP request from your web server and receive the HTTP response from the remote web site. Once you have a string with the external content, you can use various methods to replace content, such as CSS or HTML tags.
Here's a quick walkthrough of the XMLHTTP object.
www.4guysfromrolla.com/webtec...1.shtml
Good luck! -
-
Re: Get an external URL's content, remove the styles, add my styles?
Mon, March 27, 2006 - 10:07 AMalso, once you have scraped the content, you can use XSLT as well, to parse through the code, grab what you need and put it in whatever format you like...
the limitations with this are 1) the content format cannot change (i.e. if you want something in a span tag, it has to stay in the span tag, or at least have the same class name attached to it), and 2) the initial learning curve for this can be steep, if you haven't worked with it before.
you could also write a batch file that periodically gets the content and scrapes it and puts what you want into another file, locally - this would be easier if you have that as an option.
-
-
-