As I understand it it's specific to this site.
Well, it is, but it's also implemented in a fashion that would allow you to make it work for other sites, but not without having to write code. Essentially it's based around a wrapper for cURL to pull documents then a chain of "processors" all of which implement the following simple interface:
interface MarkupRewriter {
public function process($content);
}
The main controller, a singleton class called PageRequest has a default set of these that are needed on all of the amiga.org pages and allows you to add additional ones that are specific to only a few. So, in the stub "newreply.php" file, your code looks like this:
require_once('../include.main.php');
require_once('../classes.markuprewriter.editor.php');
PageRequest::getInstance()->addRewriters(
array(
new MessageEditorRewriter()
)
);
PageRequest::getInstance()->process();
Whereas most stub pages just look like this:
require_once('../include.main.php');
PageRequest::getInstance()->process();
Although this is simple, the present incarnation requires that you have a stub .php file for every target page on the site you are proxying, which was fine in this case but not useful for a general purpose proxy. A better solution would be to use some rewrite rules and have a single page through which all requests are brokered, with some parameters added invisibly in the rewrite rule that instruct the PageRequest class to bind additional MarkupRewriter instances as required.
So, yes, you could use the code to make a more general proxy for other sites, but you would want to do it in a better fashion than I did for this one
