From: Luca Padovani Date: Mon, 20 Nov 2000 12:09:23 +0000 (+0000) Subject: Added Files (for webeq): X-Git-Tag: nogzip~154 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=1aef3ed7a65337337828a25630b0097f81ae31cb;p=helm.git Added Files (for webeq): use_webeqp.pl webeq.pl webeqp.pl --- diff --git a/helm/cgi/use_webeqp.pl b/helm/cgi/use_webeqp.pl new file mode 100755 index 000000000..80a375b0b --- /dev/null +++ b/helm/cgi/use_webeqp.pl @@ -0,0 +1,13 @@ +#!/usr/bin/perl + +require CGI; +require "/local/lib/helm/configuration.pl"; + +$q = new CGI; +$uri = $q->param("uri"); + +print <new; +$request = HTTP::Request->new(GET => "$url"); +$response = $ua->request($request, \&callback); + +$content =~ s/\r//sg; +$content =~ s/\n/ /sg; +$content =~ s/]*(.*)>/$1/sg; +$content =~ s/]*>//sg; +$content =~ s/"/'/g; +$content =~ s/&/&/g; + +print < + + +Generato in automatico a partire da $url + + + + + + + + + + +EOT + +#========================= + +sub callback +{ + my ($data) = @_; + $content .= $data; +} diff --git a/helm/cgi/webeqp.pl b/helm/cgi/webeqp.pl new file mode 100755 index 000000000..50e8cfdfa --- /dev/null +++ b/helm/cgi/webeqp.pl @@ -0,0 +1,64 @@ +#!/usr/bin/perl + +require HTTP::Request; +require LWP::UserAgent; +require "/local/lib/helm/configuration.pl"; +use CGI; + +$url = $ENV{"REQUEST_URI"}; +$url =~ s/.*mmlurl=(.*)/$1/; + +$content = ""; + +$ua = LWP::UserAgent->new; +$request = HTTP::Request->new(GET => "$url"); +$response = $ua->request($request, \&callback); + +$content =~ s/\r//sg; +$content =~ s/\n/ /sg; +$content =~ s/]*>//sg; +$content =~ s/<\?xml[^?]*\?>//sg; +$content =~ s/"/'/g; +$content =~ s/&/&/g; +$content =~ s/]*>//sg; +$content =~ s/(<\/?semantics[^>]*>)//sg; +$content =~ s/()/$1 -->/sg; +$content =~ s/([^<]*)<\/mo>/$2<\/mo><\/maction>/sg; +$content =~ s/([^<]*)<\/mi>/$2<\/mi><\/maction>/sg; +$content =~ s/helm:xref='[^']*'//sg; +$content =~ s/xmlns:helm='[^']*'//sg; +$content =~ s/xlink:href='[^']*'//sg; +$content =~ s/xmlns:xlink='[^']*'//sg; +$content =~ s//&$1;/sg; + +print < + + +Generato in automatico a partire da $url + + + + + + + + + + +EOT + +#========================= + +sub callback +{ + my ($data) = @_; + $content .= $data; +}