views:

16

answers:

1

suppose that we have a complex web app that we don't want to modify directly (probably because it is too long to figure out, but also possibly because we don't even have the source for it). Instead, we want to add a few extra features to how some of its pages get displayed by directly manipulating the html pages that it generates. I think in many cases from programmer standpoint to write code that edits an html page matching some criteria is a whole lot easier than figuring out just how that page gets generated by the original script and altering that. So presumably our mashup would function as a proxy letting the AJAX calls to pass through to the underlying web app but serving pages with some modifications as needed. E.g. maybe it would append the words "1337 HAXORZ, W00T!" to the title of each page being served.

Incidentally, note that we will still control the server with the underlying application, if that is of any relevance to the situation.

I tried RTFA on Wikipedia and some other places about "server-side mashups" and it is as if it's written in Greek. Not just modern Greek, more like the proto Achaean... I guess the general impression I got from there was that these mashups have something to do with "web services", not with actual modification of complete html pages.

Ok, so any suggestions? Is what I am proposing here called by another term that I should google for? Are there frameworks available for doing things like that? Or is this something that actually nobody has ever been interested in doing in the first place?

+1  A: 

It's not really that unusual. Basically, you just download the original page from the "complex web app that we don't want to modify directly". Then, you parse it with your chosen language/library (cursing the fact that it was not written in valid HTML), make the modifications required, and serve it back out. For simple modifications, you can easily do it inline, without generating a DOM.

Matthew Flaschen
Matthew, so are there some sort of "hello world" examples of this out there? Kind of like a framework that would take care of the redirection and AJAX proxying for me and just let me put in a script or plugin that modifies the pages?
EndangeringSpecies
Yes, there are obviously many tutorials and approaches. You should probably start by narrowing down what language and server you want to use.
Matthew Flaschen