--- /dev/null
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!DOCTYPE web-app
+ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
+ "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
+
+<web-app>
+ <servlet>
+ <servlet-name>
+ Mir
+ </servlet-name>
+ <servlet-class>
+ Mir
+ </servlet-class>
+
+ <init-param>
+ <param-name>Config</param-name>
+ <param-value>etc/config.properties</param-value>
+ </init-param>
+
+ </servlet>
+
+ <servlet>
+ <servlet-name>
+ OpenMir
+ </servlet-name>
+ <servlet-class>
+ OpenMir
+ </servlet-class>
+
+ <init-param>
+ <param-name>Config</param-name>
+ <param-value>etc/config.properties</param-value>
+ </init-param>
+
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>
+ Mir
+ </servlet-name>
+ <url-pattern>
+ /Mir
+ </url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>
+ Mir
+ </servlet-name>
+ <url-pattern>
+ /servlet/Mir
+ </url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>OpenMir</servlet-name>
+ <url-pattern>/OpenMir</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>OpenMir</servlet-name>
+ <url-pattern>/servlet/OpenMir</url-pattern>
+ </servlet-mapping>
+
+ <mime-mapping>
+ <extension>
+ mp3
+ </extension>
+ <mime-type>
+ audio/x-mp3
+ </mime-type>
+ </mime-mapping>
+ <mime-mapping>
+ <extension>
+ ra
+ </extension>
+ <mime-type>
+ audio/vnd.rn-realaudio
+ </mime-type>
+ </mime-mapping>
+ <mime-mapping>
+ <extension>
+ rm
+ </extension>
+ <mime-type>
+ application/vnd.rn-realmedia
+ </mime-type>
+ </mime-mapping>
+ <mime-mapping>
+ <extension>
+ mov
+ </extension>
+ <mime-type>
+ video/quicktime
+ </mime-type>
+ </mime-mapping>
+ <mime-mapping>
+ <extension>
+ mpg
+ </extension>
+ <mime-type>
+ video/mpeg
+ </mime-type>
+ </mime-mapping>
+ <mime-mapping>
+ <extension>
+ avi
+ </extension>
+ <mime-type>
+ video/x-msvideo
+ </mime-type>
+ </mime-mapping>
+ <mime-mapping>
+ <extension>
+ asf
+ </extension>
+ <mime-type>
+ video/x-ms-asf
+ </mime-type>
+ </mime-mapping>
+ <mime-mapping>
+ <extension>
+ pdf
+ </extension>
+ <mime-type>
+ application/pdf
+ </mime-type>
+ </mime-mapping>
+</web-app>
+++ /dev/null
-#!/usr/bin/perl
-
-use CGI qw(:standard);
-use LWP::UserAgent;
-use URI::Escape;
-
-#this program takes, as CGI params, a query string "words"
-#a syntax string "bool" (and|or), values of Y or N for the
-#variables of the form hasVideo, hasAudio, hasImage, etc.
-#and a variable topic corresponding to the desired topic title
-#it then munges these variables into an appropriate request to htdig,
-# does this request and forwards the results to the user
-
-$searchhost='http://prod.indymedia.nl/cgi-bin/htsearch';
-
-$bool=param('bool');
-$hasVideo=param('hasVideo');
-$hasAudio=param('hasAudio');
-$hasImages=param('hasImages');
-$topic=param('topic');
-@topic_words=split(/\s+/,$topic);
-@words=();
-
-$querywords='';
-@words=split (/\s+/,param('words')) if param('words');
-push @words,@topic_words;
-if (@words){
-
-if ($bool eq "and"){
-$querywords=join " AND ", @words;
-}
-else{
-$querywords=join " OR ", @words;
-}
-
-$querywords =~ s/\(\)/ /g;
-$querywords="($querywords)";
-}
-
-if ($hasVideo eq "Y" || $hasAudio eq "Y" || $hasImages eq "Y"){
- $first=1;
- if (@words){
- $querywords.=" AND ";
-}
- $querywords .= "(";
-
-if ($hasVideo eq "Y"){
- if (!$first){
- $querywords.=" OR";
- }
- $querywords.=" RealVideo OR Video";
- $first=0;
-}
-
-if ($hasAudio eq "Y"){
- if (!$first){
- $querywords.=" OR";
- }
- $querywords.=" RealAudio OR Audio";
- $first=0;
-}
-
-if ($hasImages eq "Y"){
- if (!$first){
- $querywords.=" OR";
- }
- $querywords.=" ImagesGif OR ImagesJpeg";
- $first=0;
-}
- $querywords.=" )";
-}
-
-$querywords=uri_escape($querywords,"^A-Za-z0-9");
-
-$query="words=$querywords&format=builtin-long&sort=score&method=boolean";
-
-# propagate the config parameter if it is set - rob
-$config=param('config');
-$query.="&config=$config" if $config;
-
-
-
-$ua = new LWP::UserAgent;
-$ua->agent("AgentName/0.1 " . $ua->agent);
-
-# Create a request
-my $req = new HTTP::Request POST => $searchhost;
-$req->content_type('application/x-www-form-urlencoded');
-$req->content($query);
-
-# Pass request to the user agent and get a response back
-my $res = $ua->request($req);
-
-# Check the outcome of the response
-if ($res->is_success) {
- print header;
- print $res->content;
-} else {
- print header;
- print "Search engine temporarily unavailable\n";
-}