From 1aef3ed7a65337337828a25630b0097f81ae31cb Mon Sep 17 00:00:00 2001 From: Luca Padovani Date: Mon, 20 Nov 2000 12:09:23 +0000 Subject: [PATCH] Added Files (for webeq): use_webeqp.pl webeq.pl webeqp.pl --- helm/cgi/use_webeqp.pl | 13 +++++++++ helm/cgi/webeq.pl | 52 ++++++++++++++++++++++++++++++++++ helm/cgi/webeqp.pl | 64 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 129 insertions(+) create mode 100755 helm/cgi/use_webeqp.pl create mode 100755 helm/cgi/webeq.pl create mode 100755 helm/cgi/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; +} -- 2.39.2