Merge branch 'master' of feistymeow.org:feisty_meow
[feisty_meow.git] / scripts / show_db / call_movie_seeker.sh
diff --git a/scripts/show_db/call_movie_seeker.sh b/scripts/show_db/call_movie_seeker.sh
new file mode 100644 (file)
index 0000000..1240c70
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+# processes cgi request and passes it on to the real script.
+
+movie_name="$(echo $QUERY_STRING | sed -e "s/^[^=][^=]*=\(.*\)$/\1/" | sed -e "s/\+/ /g")"
+vids="$DOCUMENT_ROOT/Info/Quartz/video/video_tapes.csv"
+
+randof="$(mktemp "$TMP/zz_randocgi.XXXXXX")"
+
+bash movie_seeker.sh "$vids" "$movie_name" &>"$randof"
+
+if [ -s "$randof" ]; then
+
+  echo "Content-type: text/plain"
+  echo ""
+  echo ""
+  cat "$randof"
+
+else
+
+  echo "Content-type: text/html"
+  echo ""
+  echo ""
+  cat /home/www-data/feisty_meow/infobase/pictures/no_matches.html
+
+fi
+
+rm "$randof"
+
+