Perl

  1. Yahoo! API サンプル http://nlp.kimura-s.otaru-uc.ac.jp/Perl/YahooApi.cgi
    	#!/usr/bin/perl
    	use CGI;
    	my $charset="utf-8";
    	my $myself = './YahooApi.cgi';
    	my $title="小樽商科大学";
    	my $q = new CGI;
    	print $q->header(-charset=>$charset);
    	print $q->start_html(-title=>$title, -encoding=>$charset);
    	print "クエリ:" . $q->param('query') . "<br>\n";
    	use LWP::Simple;
    	$appid = "";
    	$query = $q->param('query');
    	$url = "http://api.search.yahoo.co.jp/WebSearchService/V1/webSearch?appid=$appid&query=$query";
    	$response = get($url);
    	print $response;
    	print $q->start_form(-method => 'POST', -action => $myself);
    	print qq|<input type="text" size="30" name="query" value="">\n|;
    	print qq|<input type="submit" name="submit" value="送信">\n|;
    	print $q->end_form();
    	print $q->end_html();