#!/Perl/bin/MSWin32-x86-object/jperl.exe require 'cgi-lib.pl'; use Unicode::Japanese; $s = Unicode::Japanese->new(); # bookmarks.htmlのパスの設定(ユーザー設定が必要) $bookmarks = $ENV{'USERDIR'}."\\Application Data\\Mozilla\\Firefox\\Profiles\\********.default\\bookmarks.html";# bookmarks.htmlのパスの設定 &ReadParse(*in); if($in{'pattern'}){ $pattern = $in{'pattern'}; $title = "RSS Feeds検索パターン: $pattern"; }else{ $pattern = ".";# ブックマークの「RSS」すべてを検索する $title = "RSS Feedsリスト"; } # 環境変数の取得 $cgidir = $ENV{'CGIDIR'}; print < RSS Feeds
$title

HEADER open(IN, "<$bookmarks"); while(){ $_ = $s->set($_,'utf8')->sjis; if(/^\s+
]+>(RSS|ATOM)<\/H3>$/){ $insw = 1; if($1 eq "RSS"){ $cgi = "rss"; }elsif($1 eq "ATOM"){ $cgi = "atom"; } }elsif(/^\s+<\/DL>/i){ $insw = 0; } if($insw == 1 && $_ =~ /^\s+
([^<]+)<\/A>$/i){ $favorite = $1; }else{ next; } if($favorite =~ /$pattern/o){ $num++; $url_encoding = &juri_encode($url); $favorite_encoding = &juri_encode($favorite); print "
\n"; } } } close(IN); print "
$num$favorite$urlメモ作成

\n"; sub juri_encode{ local($str) = @_; $str =~ s/([^a-z0-9\-_.!*'\(\)~ ])/length($1) == 2 ? sprintf "%%%1s%1s%%%1s%1s", split("",unpack("H4", $1)) : sprintf "%%%02X", ord($1)/egi; $str =~ tr/ /+/; return $str; }