/[suikacvs]/test/html-whatpm/parser.cgi
Suika

Contents of /test/html-whatpm/parser.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Tue May 1 10:27:06 2007 UTC (19 years, 6 months ago) by wakaba
Branch: MAIN
Changes since 1.1: +50 -9 lines
++ ChangeLog	1 May 2007 10:26:58 -0000
	* parser-interface.en.html: New document.

	* parser.cgi: Test-result-format mode is added.

2007-05-01  Wakaba  <wakaba@suika.fam.cx>

1 wakaba 1.1 #!/usr/bin/perl
2     use strict;
3    
4 wakaba 1.2 use lib qw[/home/httpd/html/www/markup/html/whatpm
5     /home/wakaba/public_html/-temp/wiki/lib];
6 wakaba 1.1
7     use SuikaWiki::Input::HTTP; ## TODO: Use some better CGI module
8    
9     my $http = SuikaWiki::Input::HTTP->new;
10    
11     ## TODO: _charset_
12    
13     my $mode = $http->meta_variable ('PATH_INFO');
14     ## TODO: decode unreserved characters
15    
16 wakaba 1.2 if ($mode eq '/html' or $mode eq '/test') {
17 wakaba 1.1 require Encode;
18     require What::HTML;
19     require What::NanoDOM;
20    
21     my $s = $http->parameter ('s');
22     if (length $s > 1000_000) {
23     print STDOUT "Status: 400 Document Too Long\nContent-Type: text/plain; charset=us-ascii\n\nToo long";