#!/usr/bin/perl -T use strict; use warnings; use LWP::Simple; my ($sec, $mi, $h, $d, $m, $y) = localtime(time); $y += 1900; $m++; my $aurl = "http://api.sekido.info/qreki?output=xml&year=$y&month=$m&day=$d"; my $cache_fn = "/home/yto/www/yapi/cache/$y-$m-$d.xml"; # mkdir cache mirror($aurl, $cache_fn) if not -f $cache_fn; open(my $fh, "<", $cache_fn) or die; my $data = join("", <$fh>); close $fh; my ($rokuyou_text) = $data =~ m{<rokuyou_text>(.+?)</rokuyou_text>}; my $url = "https://chart.googleapis.com/chart?chst=d_fnote_title" ."&chld=pinned_c|2|004400|h|$rokuyou_text|$y%e5%b9%b4$m%e6%9c%88$d%e6%97%a5"; print qq(Location: $url\n\n);
<img src="//yapi.ta2o.net/rokuyou/ry.cgi">