最近perlの勉強してて、naoyaのはてなダイアリー - Web::ScraperでWeb::Scraperを知り、試しにはてブのAPIを真似してニフティクリップのコメントを吐くJSONを作った。 #!/usr/local/bin/perl -T # # use strict; use warnings; use URI; use Web::Scraper; use JSON::XS; use CGI; use Encode; my $q = new CGI; print $q->header( -type=>'text/plain', -charset=>'UTF-8'); my $path_info = $q->path_info; my $path = $path_info =~ m{^/?(nobracket/)?(http\w?)://?(.*)$}xms ? $2.'://'

