#!/usr/local/bin/perl #use strict; #use warnings; use Encode qw/ from_to /; use LWP::UserAgent; #use utf8; use CGI; use HTML::Template; #binmode STDIN, ":utf8"; #binmode STDOUT, ":utf8"; use Time::HiRes qw(gettimeofday); use URI::Escape; my $lang = 'en';#en = english my @rokuseiname; my @etoname; my @starname; my @kanteiname; my @jobname; my @viar; my @viarn; my @viard; my @rokuseiunmeiname; my $kpsid;my $croozsid;my $googleid; my $matchsmartid; if($lang){ @rokuseiname = ('Saturn type','Venus type','Mars type','Uranus type','Jupiter type','Marcury type'); @etoname = ('rat','ox','tiger','rabbit','dragon','snake','horse','goat','monkey','rooster','dog','boar'); @starname = ('','Aries','Taurus','Gemini','Cancer','Leo','Virgo','Libra','Scorpio','Sagittarius','Capricorn','Aquarius','Pisces'); @kanteiname = ('','性格','性質','対人関係','恋愛性質','最高のパートナー','相性バツグン','相性イマイチ','ストレスを感じる','最悪の関係','仕事の相性','干支との相性','星との相性','年の運気','月の運気','日の運気','星座別恋愛の相性','星座別同性の相性','血液型別恋愛の相性'); @jobname = ('Ultimate Boss','Very suitable Boss','Good Boss','No Bad Boss','Not too Bad as a Boss','Normal Boss','Normal Follower','Not too Bad as a Follower','No Bad Follower','Good Follower','Very good follower','Best Follower'); $viarn[0]='seed'; $viarn[1]='bud'; $viarn[2]='flower'; $viarn[3]='sick'; $viarn[4]='achievement'; $viarn[5]='instability'; $viarn[6]='regain'; $viarn[7]='wealth'; $viarn[8]='stable'; $viarn[9]='shade'; $viarn[10]='impossible'; $viarn[11]='decline'; $viard[0]='The best term for start something. Getting married, job, or a new job. All of them are good luck.'; $viard[1]='The term to grow up. It must be a true love that you start in this term.'; $viard[2]='The important term of deciding the fortune in future. The thing which you get at this term will be unwaved in all your life.'; $viard[3]='The term of easy to occur some matters on health.Reflection for past and forecast for future.'; $viard[4]='The term to achieve things. By all mean, achieve to your goals in this term.'; $viard[5]='The tem of short pause. Do not move to anywhere, start a new business, and get or change your job.'; $viard[6]='The term of re-starting. This term is adequate to get or change your job, start a new business, move to a new place.'; $viard[7]='The term which is filled of good luck for rich ortune. In this term, all what you do becomes to money.'; $viard[8]="The term of stable and elegant. Don't think of start a new thing."; $viard[9]='The term of sequel to a trouble. Personal relationship will go downhill rapidly.'; $viard[10]='The term ofEverything goes against you. You have no way but persist in silent.'; $viard[11]='It becomes full of good luck to use all things you have stored.'; @rokuseiunmeiname = ('series of misfortunes','bitter misfortune','slight misfortune.'); }else{ @rokuseiname = ('土星人','金星人','火星人','天王星人','木星人','水星人'); @etoname = ('ねずみ','うし','とら','うさぎ','たつ','へび','うま','ひつじ','さる','とり','いぬ','いのしし'); @starname = ('','おひつじ座','おうし座','ふたご座','かに座','しし座','おとめ座','てんびん座','さそり座','いて座','やぎ座','みずがめ座','うお座'); @kanteiname = ('','性格','性質','対人関係','恋愛性質','最高のパートナー','相性バツグン','相性イマイチ','ストレスを感じる','最悪の関係','仕事の相性','干支との相性','星との相性','年の運気','月の運気','日の運気','星座別恋愛の相性','星座別同性の相性','血液型別恋愛の相性'); @jobname = ('最高の上司','非常に良い上司','良い上司','そこそこ良い上司','まあまあの上司','普通の上司','普通の部下','まあまあの部下','そこそこ良い部下','良い部下','非常に良い部下','最高の部下'); $viarn[0]='種子'; $viarn[1]='緑生'; $viarn[2]='立花'; $viarn[3]='健弱'; $viarn[4]='達成'; $viarn[5]='乱気'; $viarn[6]='再会'; $viarn[7]='財成'; $viarn[8]='安定'; $viarn[9]='陰影'; $viarn[10]='停止'; $viarn[11]='減退'; $viard[0]='物事のスタートに向いた時期。結婚、就職、転職すべて吉。'; $viard[1]='成長する時期。この時期に得た愛情は、まず本物と思ってよいでしょう。'; $viard[2]='今後の運気を決定する重要な時期。この時期に得たものは、生涯不動に。'; $viard[3]='健康面に問題が発生しやすい時期。これまでの反省と今後への展望を。'; $viard[4]='物事を達成する時期。ぜひ、この時期に完成するようにしてください。'; $viard[5]='小休止の時期。移転や開業、就職、転職は禁物。'; $viard[6]='再スタートの時期。就職、転職、開業、移転などに向いています。'; $viard[7]='財運が強い時期。やることすべてがお金になる絶好期。'; $viard[8]='優雅に安定する時期。新たに事を起こそうなどと考えてはいけません。'; $viard[9]='トラブル続きの時期。対人関係が急激に悪化します。'; $viard[10]='八方ふさがりの時期。ただおとなしく耐え忍ぶ意外にありません。'; $viard[11]='じっと我慢の時期。蓄えたものを使いきって吉。'; @rokuseiunmeiname = ('大殺界','中殺界','小殺界'); $kpsid = '1900e88c6e66';#KEITAI PREMIUM SEARCH! ID #$croozsid = '006911';#CROOZ $matchsmartid = '696_247';#matchsmart ID $googleid = '4504077977143546';#Adsence mobile } my $y;my $m;my $d;my $blood;my $s;my $u;my $p;my $r;my $e; my $name; my $type; my $star;my $starns; my $com; my $data;my $del;my $sample;my $pass;my $no;my $job;my $baseurl;my $fullbaseurl;my $xml; my $type1;my $type2;my $type3;my $type4;my $type5; my $mobile; my @emj;my $ad1;my $ad2; my $pagecont;my $mcontent; my @mdata; my @ck; my $ckmax; my @love1;my @love2;my @love3;my @love4;my @love5; my $love1txt;my $love2txt;my $love3txt;my $love4txt;my $love5txt; my @jobtxt; my @bestp; my @tbestp; my $samebirthday; my @rline1;my @rline2; my @yuline;my @muline;my @duline; my @sline;my @sdline; my @bline; my $etosynas; my $rokustarsynas; my $rokuseiyear;my $rokuseimonth;my $rokuseiday; my $horoscopelove;my $horoscopecog; my $bloodtag; my $combined;my $combined2; my $samebirthday; my @celog;my @ceilog;my @mlog; my $targeti; my @log;my @nlog; my $sort; my $starsu; my $title; my $template; my $tectag; my $accesskey = 'accesskey'; my $inputmoden;my $inputmodea; my @emj; &decode; my $sclass; my $endtag; if($com){ $endtag = '
'; }else{ $endtag = ' '; } &mobilecheck; if(!$data){ from_to($name,"shift-jis","utf8"); } my $cooksaveint = 3600; #クッキーを保持する日数 my $cookname = 'fortune'; my $cook; my $cookie;my $ckm; &get_cookie; if(($y || $type) && !$data){ &kantei; }elsif("$pass" eq '336428362436'){ &kantei; }elsif($del){ my $ci; from_to($del,"shift-jis","utf8"); for($ci=0;$ci<=$#ck;$ci++){ &csvsplit($ck[$ci]); my @ckdata = @values; if("$del" ne "$ckdata[0]" && $ckdata[0]){ $cook .= "$ck[$ci]<>"; } } from_to($cook,"utf8","shift-jis"); &set_cookie; @ck = split(/<>/, $cook); $template = HTML::Template->new(filename => './tmpl/loading.tmpl'); $template->param( NAME => $del, ); }elsif($data && $name){ $cook = "$name,$data<>"; my $ci; for($ci=0;$ci<=$#ck;$ci++){ &csvsplit($ck[$ci]); my @ckdata = @values; if("$name" ne "$ckdata[0]" && $ckdata[0]){ $cook .= "$ck[$ci]<>"; if(99 <= $ci){last;} } } from_to($cook,"utf8","shift-jis"); &set_cookie; @ck = split(/<>/, $cook); #print "Content-Type: text/html\n\n"; #print "$cook
"; #foreach (@ck) { #print "$_
"; #} #exit; $template = HTML::Template->new(filename => './tmpl/loading.tmpl'); $template->param( NAME => $name, ); }elsif($sample){ open(LOG,"./data/celebrity.cgi");@celog=;close(LOG); my $samples; foreach (@celog) { &csvsplit($_); @ckdata = @values; my $sclass; if($ckdata[4]){ $sclass = 'male'; }else{ $sclass = 'female'; } my $ename = &urlencode($ckdata[0]); if($lang){ $ckdata2 = &engmonth($ckdata[2]); $samples .= "
$ckdata[0] : $ckdata[15] : $ckdata2 $ckdata[3], $ckdata[1]
"; }else{ $samples .= "
$ckdata[0]さん : $ckdata[15] : $ckdata[1]"."年"."$ckdata[2]"."月"."$ckdata[3]"."日生まれ
"; } } $template = HTML::Template->new(filename => './tmpl/list.tmpl'); $template->param( SAMPLE => $samples, ); }elsif($mobile){ $template = HTML::Template->new(filename => './tmpl/index_m.tmpl'); $template->param( INPUTMODEN => $inputmoden, EMJ4 => $emj[4], EMJ5 => $emj[5], EMJ14 => $emj[14], EMJ15 => $emj[15], ); }else{ foreach (@ck) { &csvsplit($_); my @ckdata = @values; my $sclass; if($ckdata[4]){ $sclass = 'male'; }else{ $sclass = 'female'; } my $ename = &urlencode($ckdata[0]); if($lang){ $ckdata2 = &engmonth($ckdata[2]); $cookie .= "
$ckdata[0] : $ckdata2 $ckdata[3], $ckdata[1] [Delete]
"; }else{ $cookie .= "
$ckdata[0]さん : $ckdata[1]"."年"."$ckdata[2]"."月"."$ckdata[3]"."日生まれ [削除]
"; } } $template = HTML::Template->new(filename => './tmpl/index.tmpl'); $template->param( COOKIE => $cookie, ); } print "Content-Type: text/html\n\n", $template->output; exit; sub kantei{ if("$pass" eq '336428362436'){ open(LOG,"./celebrity_m.cgi");my @tcelog=;close(LOG); &csvsplit($tcelog[$no]); ($name,$y,$m,$d,$s,$job) = @values; } open(LOG,"./data/celebrity.cgi");@celog=;close(LOG); open(LOG,"./data/mdata.cgi");@mlog=;close(LOG); push(@ck,@celog); if(!$lang){ open(LOG,"./data/celebrity_i.cgi");@ceilog=;close(LOG); push(@ck,@ceilog); } if($#ck > 5){$ckmax = 5;} &fortune($y,$m,$d,$s,$blood); &animaltype; &animaljob; &rokusei($y,$m,$d,$s); &horoscope($y,$m,$d,$s,$blood); &combined; if($lang){ if($name){ $title = $name; }else{ $title = "You"; } }else{ if($name){ $title = $name."さん"; }else{ $title = "あなた"; } } my $ename = &urlencode($name); if($mobile && $com){ &getmobilead; from_to($title,"utf8","shift-jis"); from_to($name,"utf8","shift-jis"); if($com == 1){$mcontent = $mdata[11];} elsif($com == 2){$mcontent = $mdata[12];} elsif($com == 3){$mcontent = $mdata[13];} elsif($com == 4){$mcontent = $mdata[14];} from_to($mcontent,"utf8","shift-jis"); $pagecont = $kanteiname[$com]; from_to($pagecont,"utf8","shift-jis"); $template = HTML::Template->new(filename => './tmpl/evaluation_m1.tmpl'); $template->param( NAME => $name, PAGECONT => $pagecont, CONTENT => $mcontent, TITLE => $title, AD1 => $ad1, AD2 => $ad2, EMJ5 => $emj[5], EMJ8 => $emj[8], EMJ14 => $emj[14], EMJ15 => $emj[15], ); }elsif($mobile){ &getmobilead; from_to($title,"utf8","shift-jis"); from_to($name,"utf8","shift-jis"); my $starnames = $starname[$starns];from_to($starnames,"utf8","shift-jis"); my $rokuseinames = $rokuseiname[$u];from_to($rokuseinames,"utf8","shift-jis"); my $typenames = $mdata[2];from_to($typenames,"utf8","shift-jis"); from_to($combined,"utf8","shift-jis"); from_to($samebirthday,"utf8","shift-jis"); my $etonames = $etoname[$e];from_to($etonames,"utf8","shift-jis"); my $ep = &urlencode($p); $template = HTML::Template->new(filename => './tmpl/evaluation_m0.tmpl'); $template->param( NAME => $name, ENAME => $ename, YYYY => $y, MM => $m, DD => $d, BLOOD => $blood, SS => $s, UU => $u, PP => $p, PPE => $ep, RR => $r, EE => $e, URL => $baseurl, TYPE => $type, TITLE => $title, STAR => $star, ASTERISM => $starnames, TYPENAME => $typenames, ROKUSEI_UNMEI => $rokuseinames, ROKUSEI_PLUS => $p, ROKUSEI_REIGOU => $r, COMBINED => $combined, SAMEBIRTHDAY => $samebirthday, ETO => $etonames, AD1 => $ad1, EMJ2 => $emj[2], EMJ3 => $emj[3], EMJ4 => $emj[4], EMJ5 => $emj[5], EMJ6 => $emj[6], EMJ7 => $emj[7], EMJ9 => $emj[9], EMJ10 => $emj[10], EMJ11 => $emj[11], EMJ12 => $emj[12], EMJ13 => $emj[13], EMJ14 => $emj[14], EMJ15 => $emj[15], ); }elsif("$pass" eq '336428362436'){ $no++; my $nline = "$name,$y,$m,$d,$s,$blood,$starname[$starns],$mdata[2],$mdata[1],,,$u,$p,$r,$e,$job,\n"; my $meta; if($name){$meta = "";} print "Content-Type: text/html\n\n"; print<<"EOM"; $meta $nline EOM open(LOG,"+; print LOG $nline; close(LOG); exit; }elsif($xml){ print "Content-Type: text/xml\n\n"; print<<"EOM";
$mdata[0] $mdata[2] $mdata[11] $star $starname[$starns] $u $rokuseiname[$u]

$p

$r $e $etoname[$e] http://www.a-uranai.com/f/y_$y/m_$m/d_$d/b_$b/s_$s/u_$u/p_$p/r_$r/e_$e/ http://www.a-uranai.com/f/type_$mdata[0]/star_$star/b_$b/s_$s/u_$u/p_$p/r_$r/e_$e/
EOM exit; }elsif($lang){ $blood = &engmonth($m); $template = HTML::Template->new(filename => './tmpl/evaluation.tmpl'); $template->param( NAME => $name, ENAME => $ename, YYYY => $y, MM => $m, DD => $d, MMN => $blood, SS => $s, UU => $u, PP => $p, RR => $r, EE => $e, TYPE => $type, TITLE => $title, STAR => $star, ASTERISM => $starname[$starns], TYPEANIMAL => $mdata[1], TYPENAME => $mdata[2], ATTRIBUTE => $mdata[11], DISPOSITION => $mdata[12], RELATIONS => $mdata[13], LOVEDIS => $mdata[14], SYNASTRY1 => $love1txt, SYNASTRY2 => $love2txt, SYNASTRY3 => $love3txt, SYNASTRY4 => $love4txt, SYNASTRY5 => $love5txt, POLITIC1 => $jobtxt[0], POLITIC2 => $jobtxt[1], POLITIC3 => $jobtxt[2], POLITIC4 => $jobtxt[3], POLITIC5 => $jobtxt[4], POLITIC6 => $jobtxt[5], POLITIC7 => $jobtxt[6], POLITIC8 => $jobtxt[7], POLITIC9 => $jobtxt[8], POLITIC10 => $jobtxt[9], POLITIC11 => $jobtxt[10], POLITIC12 => $jobtxt[11], ROKUSEI_UNMEI => $rokuseiname[$u], ROKUSEI_PLUS => $p, ROKUSEI_REIGOU => $r, ETOSYNAS => $etosynas, ROKUSTARSYNAS => $rokustarsynas, ROKUSEIYEAR => $rokuseiyear, ROKUSEIMONTH => $rokuseimonth, ROKUSEIDAY => $rokuseiday, HOROSCOPELOVE => $horoscopelove, HOROSCOPECOG => $horoscopecog, BLOODTAG => $bloodtag, COMBINED => $combined, COMBINED2 => $combined2, SAMEBIRTHDAY => $samebirthday, ETO => $etoname[$e], FULLURL => $fullbaseurl, ); }else{ $template = HTML::Template->new(filename => './tmpl/evaluation.tmpl'); $template->param( NAME => $name, ENAME => $ename, YYYY => $y, MM => $m, DD => $d, BLOOD => $blood, SS => $s, UU => $u, PP => $p, RR => $r, EE => $e, TYPE => $type, TITLE => $title, STAR => $star, ASTERISM => $starname[$starns], TYPEANIMAL => $mdata[1], TYPENAME => $mdata[2], ATTRIBUTE => $mdata[11], DISPOSITION => $mdata[12], RELATIONS => $mdata[13], LOVEDIS => $mdata[14], SYNASTRY1 => $love1txt, SYNASTRY2 => $love2txt, SYNASTRY3 => $love3txt, SYNASTRY4 => $love4txt, SYNASTRY5 => $love5txt, POLITIC1 => $jobtxt[0], POLITIC2 => $jobtxt[1], POLITIC3 => $jobtxt[2], POLITIC4 => $jobtxt[3], POLITIC5 => $jobtxt[4], POLITIC6 => $jobtxt[5], POLITIC7 => $jobtxt[6], POLITIC8 => $jobtxt[7], POLITIC9 => $jobtxt[8], POLITIC10 => $jobtxt[9], POLITIC11 => $jobtxt[10], POLITIC12 => $jobtxt[11], ROKUSEI_UNMEI => $rokuseiname[$u], ROKUSEI_PLUS => $p, ROKUSEI_REIGOU => $r, ETOSYNAS => $etosynas, ROKUSTARSYNAS => $rokustarsynas, ROKUSEIYEAR => $rokuseiyear, ROKUSEIMONTH => $rokuseimonth, ROKUSEIDAY => $rokuseiday, HOROSCOPELOVE => $horoscopelove, HOROSCOPECOG => $horoscopecog, BLOODTAG => $bloodtag, COMBINED => $combined, COMBINED2 => $combined2, SAMEBIRTHDAY => $samebirthday, ETO => $etoname[$e], FULLURL => $fullbaseurl, ); } } sub fortune{ my ($yyyy,$mm,$dd,$ss,$bb) = @_; if(!$ss){$ss = '0';} my $id; if(!$type){ my $nen = substr($yyyy,2,4); my $d = int($dd / 10); my $e = $dd - ($d * 10); my $f; my $h; my $im; if($mm == 1 ){$f = (10+5*$nen+10*$d+$e+($nen-1-($nen-1)%4)/4)%60;} elsif($mm == 2 ){$f = (41+5*$nen+10*$d+$e+($nen-1-($nen-1)%4)/4)%60;} elsif($mm == 3 ){$f = (9+5*$nen+10*$d+$e+($nen-($nen)%4)/4)%60;} elsif($mm == 4 ){$f = (40+5*$nen+10*$d+$e+($nen-($nen)%4)/4)%60;} elsif($mm == 5 ){$f = (10+5*$nen+10*$d+$e+($nen-($nen)%4)/4)%60;} elsif($mm == 6 ){$f = (41+5*$nen+10*$d+$e+($nen-($nen)%4)/4)%60;} elsif($mm == 7 ){$f = (11+5*$nen+10*$d+$e+($nen-($nen)%4)/4)%60;} elsif($mm == 8 ){$f = (42+5*$nen+10*$d+$e+($nen-($nen)%4)/4)%60;} elsif($mm == 9 ){$f = (13+5*$nen+10*$d+$e+($nen-($nen)%4)/4)%60;} elsif($mm == 10){$f = (43+5*$nen+10*$d+$e+($nen-($nen)%4)/4)%60;} elsif($mm == 11){$f = (14+5*$nen+10*$d+$e+($nen-($nen)%4)/4)%60;} elsif($mm == 12){$f = (44+5*$nen+10*$d+$e+($nen-($nen)%4)/4)%60;} if($nen>87){$h=1;} elsif($nen<87 && $nen>81){$h=2;} elsif($nen<80 && $nen>70){$h=3;} elsif($nen<69 && $nen>59){$h=4;} elsif($nen<58){$h=5;} for($im=0;$im<=59;$im++){ if($f==$im){ $im = sprintf("%02d",$im); $type="d"."$ss$im"; for($id=0;$id<=$#mlog;$id++){ &csvsplit($mlog[$id]); @mdata = @values; if("$mdata[0]" eq "$type"){ $mlog[$id] =~ s/。/。/g; &csvsplit($mlog[$id]); @mdata = @values; last; } } last; } } }else{ for($id=0;$id<=$#mlog;$id++){ @mdata = split(/,/,$mlog[$id]); if("$mdata[0]" eq "$type"){ $mlog[$id] =~ s/。/。/g; &csvsplit($mlog[$id]); @mdata = @values; last; } } } } sub animaltype{ if("$mdata[16]" eq '60'){ $mdata[16] = '0'; } $mdata[16]++; if(!$s){ $mdata[16] = $mdata[16]+60; } my $love1 = $mdata[16]; &csvsplit($mlog[$love1]); @love1 = @values; if("$mdata[20]" eq '60'){ $mdata[20] = '0'; } $mdata[20]++; if(!$s){ $mdata[20] = $mdata[20]+60; } my $love5 = $mdata[20]; &csvsplit($mlog[$love5]); @love5 = @values; my $ic; my $ename; my $love1fk; my $love5fk; for($ic=0;$ic<=$#ck;$ic++){ &csvsplit($ck[$ic]); my @ckdata = @values; if(!$ckdata[4]){$ckdata[4] = '0';} if("$love1[2]" eq "$ckdata[7]" && "$s" ne "$ckdata[4]"){ $ename = &urlencode($ckdata[0]); if($ckdata[4]){ $sclass = $emj[1]; }else{ $sclass = $emj[0]; } if($ckdata[3]){ $love1fk .=<<"EOM"; $sclass$ckdata[0]$endtag EOM # }else{ # $love1fk .=<<"EOM"; #$sclass$ckdata[0]$endtag #EOM } $ck[$ic] =~ s/\s*$//; if($ckdata[15]){ push(@bestp,"$ck[$ic],100"); }else{ push(@bestp,"$ck[$ic],,,,100"); } push(@tbestp,$ckdata[0]); } if("$love5[2]" eq "$ckdata[7]" && "$s" ne "$ckdata[4]"){ $ename = &urlencode($ckdata[0]); if($ckdata[4]){ $sclass = $emj[1]; }else{ $sclass = $emj[0]; } $love5fk .=<<"EOM"; $sclass$ckdata[0]$endtag EOM if(!$ckdata[15]){ push(@bestp,"$ck[$ic],,,,0"); push(@tbestp,$ckdata[0]); } } if("$name" ne "$ckdata[0]" && "$m" eq "$ckdata[2]" && "$d" eq "$ckdata[3]"){ $ename = &urlencode($ckdata[0]); if($mobile){ if($ckdata[4]){ $sclass = $emj[1]; }else{ $sclass = $emj[0]; } $samebirthday .= "$sclass$ckdata[0]
"; }else{ if($ckdata[4]){ $sclass = 'male'; }else{ $sclass = 'female'; } if($lang){ my $engmonth = &engmonth($ckdata[2]); $samebirthday .= "
$ckdata[0] : $ckdata[15] : $engmonth $ckdata[3], $ckdata[1]
"; }else{ $samebirthday .= "
$ckdata[0] : $ckdata[15] : $ckdata[1]"."年"."$ckdata[2]"."月"."$ckdata[3]"."日
"; } } } } if($lang){ $love1txt = "$love1[2]
$love1fk"; }elsif($com == 5){ $mcontent = "$love1[2]
$love1fk
一般人では→
igossoで検索
あちゅらで検索"; }elsif(!$mobile){ $love1txt = "$love1[2]
$love1fk
一般人では→igossoで検索 あちゅらで検索"; } if($com == 9){ $mcontent = "$love5[2]
$love5fk"; }elsif(!$mobile){ $love5txt = "$love5[2]
$love5fk"; } @love2 = split(/\./,$mdata[17]); my $i; for($i=0;$i<=$#love2;$i++){ if("$love2[$i]" eq '60'){ $love2[$i] = '0'; } $love2[$i]++; if(!$s){ $love2[$i] = $love2[$i]+60; } my $love2l = $love2[$i]; &csvsplit($mlog[$love2l]); my @love2d = @values; my $cii = 0; my $cii2 = 0; my $love2fk; for($ic=0;$ic<=$#ck;$ic++){ &csvsplit($ck[$ic]); my @ckdata = @values; if(!$ckdata[4]){$ckdata[4] = '0';} if("$love2d[2]" eq "$ckdata[7]" && "$s" ne "$ckdata[4]"){ if($cii <= $ckmax && $ckdata[3]){ $ename = &urlencode($ckdata[0]); if($ckdata[4]){ $sclass = $emj[1]; }else{ $sclass = $emj[0]; } $love2fk .=<<"EOM"; $sclass$ckdata[0]$endtag EOM $cii++; } # if($cii2 <= $ckmax && !$ckdata[3]){ # $ename = &urlencode($ckdata[0]); # if($ckdata[4]){ # $sclass = $emj[1]; # }else{ # $sclass = $emj[0]; # } # $love2fk .=<<"EOM"; #$sclass$ckdata[0]$endtag #EOM # $cii2++; # } if($ckdata[15]){ $ck[$ic] =~ s/\s*$//; push(@bestp,"$ck[$ic],90"); }else{ push(@bestp,"$ck[$ic],,,,90"); } push(@tbestp,$ckdata[0]); } } if($lang){ $love2txt .= "$love2d[2]
$love2fk

"; }elsif($com == 6){ $mcontent .= "$love2d[2]
$love2fk
一般人では→
igossoで検索
あちゅらで検索

"; }elsif(!$mobile){ $love2txt .= "$love2d[2]
$love2fk
一般人では→igossoで検索 あちゅらで検索

"; } } @love3 = split(/\./,$mdata[18]); for($i=0;$i<=$#love3;$i++){ if("$love3[$i]" eq '60'){ $love3[$i] = '0'; } $love3[$i]++; if(!$s){ $love3[$i] = $love3[$i]+60; } my $love3l = $love3[$i]; &csvsplit($mlog[$love3l]); my @love3d = @values; my $cii = 0; my $love3fk; for($ic=0;$ic<=$#ck;$ic++){ &csvsplit($ck[$ic]); my @ckdata = @values; if(!$ckdata[4]){$ckdata[4] = '0';} if("$love3d[2]" eq "$ckdata[7]" && "$s" ne "$ckdata[4]"){ $ename = &urlencode($ckdata[0]); if($ckdata[4]){ $sclass = $emj[1]; }else{ $sclass = $emj[0]; } $love3fk .=<<"EOM"; $sclass$ckdata[0]$endtag EOM $cii++; if(!$ckdata[15]){ push(@bestp,"$ck[$ic],,,,20"); push(@tbestp,$ckdata[0]); } if($cii > $ckmax){last;} } } if($com == 7){ $mcontent .= "$love3d[2]
$love3fk
"; }elsif(!$mobile){ $love3txt .= "$love3d[2]
$love3fk

"; } } @love4 = split(/\./,$mdata[19]); for($i=0;$i<=$#love4;$i++){ if("$love4[$i]" eq '60'){ $love4[$i] = '0'; } $love4[$i]++; if(!$s){ $love4[$i] = $love4[$i]+60; } my $love4l = $love4[$i]; &csvsplit($mlog[$love4l]); my @love4d = @values; my $cii = 0; my $love4fk; for($ic=0;$ic<=$#ck;$ic++){ &csvsplit($ck[$ic]); my @ckdata = @values; if(!$ckdata[4]){$ckdata[4] = '0';} if("$love4d[2]" eq "$ckdata[7]" && "$s" ne "$ckdata[4]"){ $ename = &urlencode($ckdata[0]); if($ckdata[4]){ $sclass = $emj[1]; }else{ $sclass = $emj[0]; } $love4fk .=<<"EOM"; $sclass$ckdata[0]$endtag EOM $cii++; if(!$ckdata[15]){ push(@bestp,"$ck[$ic],,,,10"); push(@tbestp,$ckdata[0]); } if($cii > $ckmax){last;} } } if($com == 8){ $mcontent .= "$love4d[2]
$love4fk
"; }elsif(!$mobile){ $love4txt .= "$love4d[2]
$love4fk

"; } } for($ic=0;$ic<$ckm;$ic++){ &csvsplit($ck[$ic]); my @ckdata = @values; my $hit; my $ii; for($ii=0;$ii<=$#tbestp;$ii++){ if("$tbestp[$ii]" eq "$ckdata[0]"){ $hit = 1;last; } } if(!$ckdata[4]){$ckdata[4] = '0';} if(!$hit && "$s" ne "$ckdata[4]"){ push(@tbestp,$ckdata[0]); push(@bestp,"$ck[$ic],,,,50"); } } } sub animaljob{ my @jb = split(/\./,$mdata[15]); my $i; my $ename; for($i=0;$i<=$#jb;$i++){ if($targeti){$i = $targeti;} my $cii = 0; my $sfk; my $ic; my $jbi = $jb[$i]; for($ic=0;$ic<=$#ck;$ic++){ if(index("$ck[$ic]", "$jb[$i]") >= 0){ &csvsplit($ck[$ic]); my @ckdata = @values; if("$jb[$i]" eq "$ckdata[8]" && "$name" ne "$ckdata[0]"){ $ename = &urlencode($ckdata[0]); if($ckdata[4]){ $sclass = $emj[1]; }else{ $sclass = $emj[0]; } $sfk .=<<"EOM"; $sclass$ckdata[0]$endtag EOM $cii++; if($cii > $ckmax){ $sfk = "$ckdata[8]
".$sfk; last; } } } } if($com == 10){ $mcontent .= "$jobname[$i]
$sfk
"; }else{ $jobtxt[$i] = $sfk; } } } sub rokusei{ my ($yyyy,$mm,$dd,$ss) = @_; my $times = time; #$times = $times - 60*60*24* 476; my ($nowsec,$nowmin,$nowh,$nowd,$nowm,$nowy,$nowwday,$nowyday,$nowisdst) = localtime($times); $nowy += 1900; $nowm = $nowm +1; $yyyy = $yyyy - 1900; $mm = $mm - 1; my $ty = $nowy; my $tm = $nowm-1; my $td = $nowd; my $yu; my $mu; my $du; my $pu=-($yyyy%2); $viar[0]=70; $viar[1]=55; $viar[2]=70; $viar[3]=40; $viar[4]=99; $viar[5]=30; $viar[6]=80; $viar[7]=70; $viar[8]=80; $viar[9]=10; $viar[10]=0; $viar[11]=10; if(!$u){ $du = 365 * $ty + int($ty/4) + $td; if($tm>0){$du+=31;} elsif($tm>1){ $du+=28; if(($tm>1) && ($ty%4==0)){$du+=1;} } elsif($tm>2){$du+=31;} elsif($tm>3){$du+=30;} elsif($tm>4){$du+=31;} elsif($tm>5){$du+=30;} elsif($tm>6){$du+=31;} elsif($tm>7){$du+=31;} elsif($tm>8){$du+=30;} elsif($tm>9){$du+=31;} elsif($tm>10){$du+=30;} $du = int( $times / (60*60*24)); $du -= 6; my $tmpunmei = $yyyy % 4; my $punmei; if($tmpunmei == 0){ $punmei = 1; }else{ $punmei = 0; } $u = 9+365*$yyyy+($yyyy-$tmpunmei)/4+$dd-$punmei; if($mm>0){$u+=31;} if($mm>1){$u+=28;} if(($mm>1) && ($yyyy%4==0)){$u+=1;} if($mm>2){$u+=31;} if($mm>3){$u+=30;} if($mm>4){$u+=31;} if($mm>5){$u+=30;} if($mm>6){$u+=31;} if($mm>7){$u+=31;} if($mm>8){$u+=30;} if($mm>9){$u+=31;} if($mm>10){$u+=30;} $u=(($u%60)-(($u%60)%10))/10; if((11-(($yyyy+$pu+1)%12))/2 == $u){ $r = 1; }else{ $r = 0; } if($pu==0){ $p = '+'; }else{ $p = '-'; } } if($p ne '+'){$p = '-';} if($u==0){ $yu=($ty+$pu-4)%12; $mu=($tm+$pu+1)%12; $du=($du+$pu-1)%12; }elsif($u==1){ $yu=($ty+$pu-2)%12; $mu=($tm+$pu+3)%12; $du=($du+$pu+1)%12; }elsif($u==2){ $yu=($ty+$pu+0)%12; $mu=($tm+$pu+5)%12; $du=($du+$pu+5)%12; if($pu == -1){$du--;} }elsif($u==3){ $yu=($ty+$pu+2)%12; $mu=($tm+$pu+7)%12; $du=($du+$pu+5)%12; }elsif($u==4){ $yu=($ty+$pu+4)%12; $mu=($tm+$pu+9)%12; $du=($du+$pu+7)%12; }elsif($u==5){ $yu=($ty+$pu+6)%12; $mu=($tm+$pu+11)%12; $du=($du+$pu+9)%12; } if(!$e){ $e = $yyyy % 12; } open(LOG,"./data/rdata.cgi");my @rlog=;close(LOG); my @rdata = split(/\,/,$rlog[0]); my @irdata; my $i; my $ir; for($i=1;$i<=12;$i++){ if("$rokuseiname[$u]$p" eq "$rdata[$i]"){ for($ir=1;$ir<=12;$ir++){ @irdata = split(/\,/,$rlog[$ir]); push(@rline1,"$irdata[0],$irdata[$i]"); } last; } } @log = @rline1; $sort = 1; &sort; @rline1 = @nlog; &rokuseieto; @rdata = split(/\,/,$rlog[14]); for($i=1;$i<=6;$i++){ if("$rokuseiname[$u]" eq "$rdata[$i]"){ for($ir=15;$ir<=20;$ir++){ @irdata = split(/\,/,$rlog[$ir]); push(@rline2,"$irdata[0],$irdata[$i]"); } last; } } @log = @rline2; $sort = 1; &sort; @rline2 = @nlog; &rokuseistar; my $yumin = $yu-3; if($yumin < 0){$yumin=12+$yumin;} my $yearmin = $nowy-3; my $ii; for($i=$yumin;$i<=11;$i++){ if($r){ $ii=$i-6; if($ii < 0){$ii=12+$ii;} } push(@yuline,"$yearmin,$viar[$i],$viar[$ii],$viarn[$i],$viarn[$ii],\"$viard[$i]\",\"$viard[$ii]\""); $yearmin++; } if($yumin){ for($i=0;$i<$yumin;$i++){ if($r){ $ii=$i-6; if($ii < 0){$ii=12+$ii;} } push(@yuline,"$yearmin,$viar[$i],$viar[$ii],$viarn[$i],$viarn[$ii],\"$viard[$i]\",\"$viard[$ii]\""); $yearmin++; } } &rokuseiyear($nowy,$nowm,$nowd); my $mumin = $mu-3; if($mumin < 0){$mumin=12+$mumin;} my $monthmin = $nowm-3; for($i=$mumin;$i<=11;$i++){ if($r){ $ii=$i-6; if($ii < 0){$ii=12+$ii;} } push(@muline,"$monthmin,$viar[$i],$viar[$ii],$viarn[$i],$viarn[$ii],\"$viard[$i]\",\"$viard[$ii]\""); $monthmin++; if($monthmin > 12){$monthmin = 1;} } if($mumin){ for($i=0;$i<$mumin;$i++){ if($r){ $ii=$i-6; if($ii < 0){$ii=12+$ii;} } push(@muline,"$monthmin,$viar[$i],$viar[$ii],$viarn[$i],$viarn[$ii],\"$viard[$i]\",\"$viard[$ii]\""); $monthmin++; if($monthmin > 12){$monthmin = 1;} } } &rokuseimonth($nowy,$nowm,$nowd); my $nlastday;my $lastday; if($nowm == 1){$nlastday = 31;$lastday = 31;} elsif($nowm == 2){$nlastday = 28;$lastday = 31;} elsif($nowm == 3){$nlastday = 31;$lastday = 28;} elsif($nowm == 4){$nlastday = 30;$lastday = 31;} elsif($nowm == 5){$nlastday = 31;$lastday = 30;} elsif($nowm == 6){$nlastday = 30;$lastday = 31;} elsif($nowm == 7){$nlastday = 31;$lastday = 30;} elsif($nowm == 8){$nlastday = 31;$lastday = 31;} elsif($nowm == 9){$nlastday = 30;$lastday = 31;} elsif($nowm ==10){$nlastday = 31;$lastday = 30;} elsif($nowm ==11){$nlastday = 30;$lastday = 31;} else{$nlastday = 31;$lastday = 30;} my $dumin = $du-3; if($dumin < 0){$dumin=12+$dumin;} my $daymin = $nowd-3; my $ti; for($i=$dumin;$i<=11;$i++){ if($r){ $ii=$i-6; if($ii < 0){$ii=12+$ii;} } push(@duline,"$daymin,$viar[$i],$viar[$ii],$viarn[$i],$viarn[$ii],\"$viard[$i]\",\"$viard[$ii]\""); $ti++; $daymin++; if($ti < 3){ if($daymin > $nlastday){ $daymin = 1; } }elsif($ti == 3){ }else{ if($daymin > $nlastday){ $daymin = 1; } } } if($dumin){ for($i=0;$i<$dumin;$i++){ if($r){ $ii=$i-6; if($ii < 0){$ii=12+$ii;} } push(@duline,"$daymin,$viar[$i],$viar[$ii],$viarn[$i],$viarn[$ii],\"$viard[$i]\",\"$viard[$ii]\""); $ti++; $daymin++; if($ti < 3){ if($daymin > $lastday){ $daymin = 1; } }elsif($ti == 3){ }else{ if($daymin > $nlastday){ $daymin = 1; } } } } &rokuseiday($nowy,$nowm,$nowd,$nlastday,$lastday); } sub rokuseieto{ my $i; my $ic; my $ename; my @bestp2; for($i=0;$i<=$#rline1;$i++){ if($targeti){$i = $targeti;} my @rdata = split(/\,/,$rline1[$i]); my $rfk; my $cii = 0; for($ic=0;$ic<=$#ck;$ic++){ my @ckdata = split(/\,/,$ck[$ic]); my $eto = $ckdata[14]; $eto = $etoname[$eto]; if("$rdata[0]" eq "$eto" && "$name" ne "$ckdata[0]"){ $ename = &urlencode($ckdata[0]); if($ckdata[4]){ $sclass = $emj[1]; }else{ $sclass = $emj[0]; } $rfk .=<<"EOM"; $sclass$ckdata[0]$endtag EOM $cii++; if($cii > $ckmax){last;} } } for($ic=0;$ic<=$#bestp;$ic++){ my @ckdata = split(/\,/,$bestp[$ic]); my $eto = $ckdata[14]; $eto = $etoname[$eto]; if("$rdata[0]" eq "$eto" && "$name" ne "$ckdata[0]"){ my $starimage = &star($rdata[1]); $ckdata[$#ckdata] = $ckdata[$#ckdata] + $starsu; push(@bestp2,"$bestp[$ic],$ckdata[$#ckdata]"); } } my $starimage = &star($rdata[1]); if($com == 11){ $mcontent .= "$rdata[0]

$rfk
"; }else{ $etosynas .=<<"EOM"; $rdata[0] $rfk EOM } } @bestp = @bestp2; } sub rokuseistar{ my $i; my $ic; my $ename; my @bestp2; for($i=0;$i<=$#rline2;$i++){ if($targeti){$i = $targeti;} my @rdata = split(/\,/,$rline2[$i]); my $rfk; my $cii = 0; for($ic=0;$ic<=$#ck;$ic++){ my @ckdata = split(/\,/,$ck[$ic]); my $rsno = $ckdata[11]; if("$rdata[0]" eq "$rokuseiname[$rsno]" && "$name" ne "$ckdata[0]"){ $ename = &urlencode($ckdata[0]); if($ckdata[4]){ $sclass = $emj[1]; }else{ $sclass = $emj[0]; } $rfk .=<<"EOM"; $sclass$ckdata[0]$endtag EOM $cii++; if($cii > $ckmax){last;} } } for($ic=0;$ic<=$#bestp;$ic++){ my @ckdata = split(/\,/,$bestp[$ic]); my $rsno = $ckdata[11]; if("$rdata[0]" eq "$rokuseiname[$rsno]" && "$name" ne "$ckdata[0]"){ my $starimage = &star($rdata[1]); $ckdata[$#ckdata] = $ckdata[$#ckdata] + $starsu; push(@bestp2,"$bestp[$ic],$ckdata[$#ckdata]"); } } my $starimage = &star($rdata[1]); if($com == 12){ $mcontent .= "$rdata[0]

$rfk
"; }else{ $rokustarsynas .=<<"EOM"; $rdata[0] $rfk EOM } } @bestp = @bestp2; } sub rokuseiyear{ my ($nowy,$nowm,$nowd) = @_; my $i; my $dskcom; my $hereclass; my $star2; my $star2image; my $unkiname; my $unkidetail; my $starsu2; for($i=0;$i<=11;$i++){ if($mobile && !$i){$i = 3;} &csvsplit($yuline[$i]); my @yudata = @values; if($yudata[1] < 30){ $dskcom = "$rokuseiunmeiname[0]"; }elsif($yudata[1] == 40){ $dskcom = "$rokuseiunmeiname[2]"; }elsif($yudata[1] == 30){ $dskcom = "$rokuseiunmeiname[1]"; }else{ $dskcom = ''; } if("$yudata[0]" eq "$nowy"){ $hereclass = 'class="slphere"'; }else{ $hereclass = ''; } if($r){ $star2 = &star($yudata[2]); $unkiname = "$yudata[3] & $yudata[4]"; $unkidetail = "$yudata[5]
$yudata[6]"; $starsu2 = "($starsu)"; $star2image = "
"; }else{ $unkiname = "$yudata[3]"; $unkidetail = "$yudata[5]"; $starsu2 = ""; $star2image = ""; } my $starimage = &star($yudata[1]); if(!$lang){ $yudata[0] = $yudata[0]."年"; } if($com == 13){ $mcontent .=<<"EOM"; $yudata[0] $unkiname$dskcom
$star2image
$unkidetail

EOM }else{ $rokuseiyear .=<<"EOM"; $yudata[0]
$unkiname
$dskcom $star2image $unkidetail EOM } } } sub rokuseimonth{ my ($nowy,$nowm,$nowd) = @_; my $i; my $dskcom; my $hereclass; my $star2; my $star2image; my $unkiname; my $unkidetail; my $starsu2; my $muyear; for($i=0;$i<=11;$i++){ if($mobile && !$i){$i = 3;} &csvsplit($muline[$i]); my @mudata = @values; if($mudata[1] < 30){ $dskcom = "$rokuseiunmeiname[0]"; }elsif($mudata[1] == 40){ $dskcom = "$rokuseiunmeiname[2]"; }elsif($mudata[1] == 30){ $dskcom = "$rokuseiunmeiname[1]"; }else{ $dskcom = ''; } if("$mudata[0]" eq "$nowm"){ $hereclass = 'class="slphere"'; }else{ $hereclass = ''; } if($i < 3){ if($mudata[0] > $nowm){ $muyear = $nowy - 1; }else{ $muyear = $nowy; } }elsif($i == 3){ $muyear = $nowy; }else{ if($mudata[0] < $nowm){ $muyear = $nowy + 1; }else{ $muyear = $nowy; } } if($mudata[0] < 1){ $muyear = $muyear-1; $mudata[0] = 12+$mudata[0]; } if($r){ $star2 = &star($mudata[2]); $unkiname = "$mudata[3] & $mudata[4]"; $unkidetail = "$mudata[5]
$mudata[6]"; $starsu2 = "($starsu)"; $star2image = "
"; }else{ $unkiname = "$mudata[3]"; $unkidetail = "$mudata[5]"; $star2 = 'shim.gif'; $starsu2 = ""; $star2image = ""; } my $starimage = &star($mudata[1]); if($lang){ $mudata[0] = &engmonth($mudata[0]); $rokuseimonth .=<<"EOM"; $mudata[0], $muyear
$unkiname
$dskcom $star2image $unkidetail EOM }else{ $muyear = $muyear."年"; $mudata[0] = $mudata[0]."月"; if($com == 14){ $mcontent .=<<"EOM"; $muyear$mudata[0] $unkiname$dskcom
$star2image
$unkidetail

EOM }else{ $rokuseimonth .=<<"EOM"; $muyear$mudata[0]
$unkiname
$dskcom $star2image $unkidetail EOM } } } } sub rokuseiday{ my ($nowy,$nowm,$nowd,$nlastday,$lastday) = @_; my $i; my $dskcom; my $hereclass; my $star2; my $star2image; my $unkiname; my $unkidetail; my $starsu2; my $duyear; my $dumonth; for($i=0;$i<=11;$i++){ if($mobile && !$i){$i = 3;} &csvsplit($duline[$i]); my @dudata = @values; if($dudata[1] < 30){ $dskcom = "$rokuseiunmeiname[0]"; }elsif($dudata[1] == 40){ $dskcom = "$rokuseiunmeiname[2]"; }elsif($dudata[1] == 30){ $dskcom = "$rokuseiunmeiname[1]"; }else{ $dskcom = ''; } if("$dudata[0]" eq "$nowd"){ $hereclass = 'class="slphere"'; }else{ $hereclass = ''; } if($i < 3){ if($dudata[0] > $nowd){ $duyear = $nowy - 1; $dumonth = $nowm - 1; }else{ $duyear = $nowy; $dumonth = $nowm; } }elsif($i == 3){ $duyear = $nowy; $dumonth = $nowm; }else{ if($dudata[0] < $nowd){ $duyear = $nowy + 1; $dumonth = $nowm + 1; }else{ $duyear = $nowy; $dumonth = $nowm; } } if($dudata[0] < 1 && $dumonth == 1){ $duyear = $duyear-1; $dumonth = 12; $dudata[0] = $lastday+$dudata[0]; }elsif($dudata[0] < 1){ $dumonth = $dumonth - 1; $dudata[0] = $lastday+$dudata[0]; } if($dumonth > 12){$dumonth = 1;} if($r){ $star2 = &star($dudata[2]); $unkiname = "$dudata[3] & $dudata[4]"; $unkidetail = "$dudata[5]
$dudata[6]"; $starsu2 = "($starsu)"; $star2image = "
"; }else{ $unkiname = "$dudata[3]"; $unkidetail = "$dudata[5]"; $star2 = 'shim.gif'; $starsu2 = ""; $star2image = ""; } my $starimage = &star($dudata[1]); if($lang){ $dumonth = &engmonth($dumonth); $rokuseiday .=<<"EOM"; $dumonth $dudata[0], $duyear
$unkiname
$dskcom $star2image $unkidetail EOM }else{ $duyear = $duyear."年"; $dumonth = $dumonth."月"; $dudata[0] = $dudata[0]."日"; if($com == 15){ $mcontent .=<<"EOM"; $duyear$dumonth$dudata[0] $unkiname$dskcom
$star2image
$unkidetail

EOM }else{ $rokuseiday .=<<"EOM"; $duyear$dumonth$dudata[0]
$unkiname
$dskcom $star2image $unkidetail EOM } } } } sub horoscope{ my ($yyyy,$mm,$dd,$ss,$bb) = @_; open(LOG,"./data/sdata.cgi");my @slog=;close(LOG); my $sid; my $sir; my $seiza; my $starid; my $ps; if($ss){ $sid = 1; $sir = 3; $ps = 'm'; }else{ $sid = 3; $sir = 1; $ps = 'w'; } if(!$star){ my $tmm = sprintf("%02d",$mm); my $tdd = sprintf("%02d",$dd); my $mmdd = "$tmm$tdd"; if($mmdd >= 120 && $mmdd <= 218){ $star = 11; }elsif($mmdd >= 219 && $mmdd <= 320){ $star = 12; }elsif($mmdd >= 321 && $mmdd <= 419){ $star = 1; }elsif($mmdd >= 420 && $mmdd <= 520){ $star = 2; }elsif($mmdd >= 521 && $mmdd <= 621){ $star = 3; }elsif($mmdd >= 622 && $mmdd <= 722){ $star = 4; }elsif($mmdd >= 723 && $mmdd <= 822){ $star = 5; }elsif($mmdd >= 823 && $mmdd <= 922){ $star = 6; }elsif($mmdd >= 923 && $mmdd <= 1023){ $star = 7; }elsif($mmdd >= 1024 && $mmdd <= 1121){ $star = 8; }elsif($mmdd >= 1122 && $mmdd <= 1221){ $star = 9; }else{ $star = 10; } $seiza = $starname[$star]; $starid = $sid-1; $starns = $star; $star = "$star$ps"; }else{ $starns = $star; $starns =~ s/m//g; $starns =~ s/w//g; my $is; for($is=1;$is<=144;$is++){ &csvsplit($slog[$is]); my @sdata = @values; if("$star" eq "$sdata[0]"){ $seiza = $sdata[1]; $starid = 0; last; }elsif("$star" eq "$sdata[2]"){ $seiza = $sdata[3]; $starid = 2; last; } } } my $is; for($is=1;$is<=144;$is++){ &csvsplit($slog[$is]); my @sdata = @values; if("$sdata[$sid]" eq "$seiza"){ $sdata[5] =~ s/\s*$//; push(@sline,"$sdata[$sir],$sdata[4],\"$sdata[5]\""); } } @log = @sline; $sort = 1; &sort; @sline = @nlog; &horoscopelove; my $sddata; my $min; my $max; if($s){ $min = 145; $max = 222; }else{ $min = 223; $max = 300; } for($is=$min;$is<=$max;$is++){ &csvsplit($slog[$is]); my @sdata = @values; if("$sdata[1]" eq "$seiza" || "$sdata[3]" eq "$seiza"){ $sdata[4] =~ s/\s*$//; if("$sdata[1]" eq "$seiza"){ $sddata = $sdata[3]; }else{ $sddata = $sdata[1]; } push(@sdline,"$sddata,$sdata[4],\"$sdata[5]\""); } } @log = @sdline; $sort = 1; &sort; @sdline = @nlog; &horoscopecog; if($blood){ open(LOG,"./data/bdata.cgi");my @blog=;close(LOG); for($is=0;$is<=15;$is++){ &csvsplit($blog[$is]); my @bdata = @values; if("$bdata[$sid]" eq "$bb"){ $bdata[5] =~ s/\s*$//; push(@bline,"$bdata[$sir],$bdata[4],\"$bdata[5]\""); } } @log = @bline; $sort = 1; &sort; @bline = @nlog; &blood; } } sub horoscopelove{ my $i; my $ic; my $ename; my @bestp2; for($i=0;$i<=$#sline;$i++){ if($targeti){$i = $targeti;} &csvsplit($sline[$i]); my @sdata = @values; my $sfk = ''; my $cii = 0; for($ic=0;$ic<=$#ck;$ic++){ &csvsplit($ck[$ic]); my @ckdata = @values; if($s eq '0' && !$ckdata[4]){$ckdata[4] = '0';} if("$sdata[0]" eq "$ckdata[6]" && "$s" ne "$ckdata[4]"){ $ename = &urlencode($ckdata[0]); if($ckdata[4]){ $sclass = $emj[1]; }else{ $sclass = $emj[0]; } $sfk .=<<"EOM"; $sclass$ckdata[0]$endtag EOM $cii++; if($cii > $ckmax){last;} } } for($ic=0;$ic<=$#bestp;$ic++){ &csvsplit($bestp[$ic]); my @ckdata = @values; my $seiza = $ckdata[11]; $seiza = $starname[$seiza]; if("$sdata[0]" eq "$ckdata[6]"){ my $starimage = &star($sdata[1]); $ckdata[$#ckdata] = $ckdata[$#ckdata] + $starsu; push(@bestp2,"$bestp[$ic],$ckdata[$#ckdata]"); } } my $starimage = &star($sdata[1]); if($com == 16){ $mcontent .=<<"EOM"; $sdata[0]

$sdata[2]
$sfk
EOM }else{ $horoscopelove .=<<"EOM"; $sdata[0] $sdata[2]
$sfk EOM } } @bestp = @bestp2; @bestp2 = (); } sub horoscopecog{ my $i; my $ic; my $ename; for($i=0;$i<=$#sdline;$i++){ if($targeti){$i = $targeti;} &csvsplit($sdline[$i]); my @sdata = @values; my $sfk = ''; my $cii = 0; for($ic=0;$ic<=$#ck;$ic++){ &csvsplit($ck[$ic]); my @ckdata = @values; if($s eq '0' && !$ckdata[4]){$ckdata[4] = '0';} if("$sdata[0]" eq "$ckdata[6]" && "$s" eq "$ckdata[4]" && "$name" ne "$ckdata[0]"){ $ename = &urlencode($ckdata[0]); if($ckdata[4]){ $sclass = $emj[1]; }else{ $sclass = $emj[0]; } $sfk .=<<"EOM"; $sclass$ckdata[0]$endtag EOM $cii++; if($cii > $ckmax){last;} } } my $starimage = &star($sdata[1]); if($com == 17){ $mcontent .=<<"EOM"; $sdata[0]

$sdata[2]
$sfk
EOM }else{ $horoscopecog .=<<"EOM"; $sdata[0] $sdata[2]
$sfk EOM } } } sub blood{ my $i; my $ic; my $ename; my @bestp2; for($i=0;$i<=$#bline;$i++){ &csvsplit($bline[$i]); my @bdata = @values; my $sfk = ''; my $cii = 0; for($ic=0;$ic<=$#ck;$ic++){ my @ckdata = split(/\,/,$ck[$ic]); if(!$ckdata[4]){$ckdata[4] = '0';} if("$bdata[0]" eq "$ckdata[5]" && "$s" ne "$ckdata[4]"){ $ename = &urlencode($ckdata[0]); if($ckdata[4]){ $sclass = $emj[1]; }else{ $sclass = $emj[0]; } $sfk .=<<"EOM"; $sclass$ckdata[0]$endtag EOM $cii++; if($cii > $ckmax){last;} } } for($ic=0;$ic<=$#bestp;$ic++){ my @ckdata = split(/\,/,$bestp[$ic]); if("$bdata[0]" eq "$ckdata[5]"){ my $starimage = &star($bdata[1]); $ckdata[$#ckdata] = $ckdata[$#ckdata] + $starsu; push(@bestp2,"$bestp[$ic],$ckdata[$#ckdata]"); } } $bdata[0] = $bdata[0]."型"; my $starimage = &star($bdata[1]); if($com == 18){ $mcontent .=<<"EOM"; $bdata[0]

$bdata[2]
$sfk
EOM }else{ $bloodtag .=<<"EOM"; $bdata[0] $bdata[2]
$sfk EOM } } @bestp = @bestp2; @bestp2 = (); } sub combined{ my @ckdata = split(/\,/,$bestp[0]); @log = @bestp; $sort = $#ckdata; &sort; @bestp = @nlog; my $bestcnt = 0; my $ename; my $ic; my $sclass; my $ckdata1; my $ckdata2; my $ckdata3; for($ic=0;$ic<5;$ic++){ my @ckdata = split(/\,/,$bestp[$ic]); $ename = &urlencode($ckdata[0]); if($lang){ $ckdata1 = $ckdata[1]; $ckdata2 = $ckdata[2]; $ckdata3 = $ckdata[3]; }else{ $ckdata1 = $ckdata[1]."年"; $ckdata2 = $ckdata[2]."月"; $ckdata3 = $ckdata[3]."日"; } if($mobile){ if($ckdata[4]){ $sclass = $emj[1]; }else{ $sclass = $emj[0]; } $combined .= "$sclass$ckdata[0]".':'.$ckdata[15].':'."相性 $ckdata[$sort]".'%
'; }else{ if($ckdata[4]){ $sclass = 'male'; }else{ $sclass = 'female'; } if($lang){ $ckdata2 = &engmonth($ckdata2); $combined .=<<"EOM";
$ckdata[0] : $ckdata[15] : $ckdata2 $ckdata3, $ckdata1 : Chemistry $ckdata[$sort]%
EOM }else{ $combined .=<<"EOM";
$ckdata[0] : $ckdata[15] : $ckdata1$ckdata2$ckdata3 : 相性 $ckdata[$sort]%
EOM } } } if(@tbestp){ my $bestcnt = 0; for($ic=0;$ic<=$#bestp;$ic++){ &csvsplit($bestp[$ic]); @ckdata = @values; $ename = &urlencode($ckdata[0]); if($ckdata[15]){next;} if($ckdata[4]){ $sclass = 'male'; }else{ $sclass = 'female'; } if($lang){ $combined2 .=<<"EOM";
$ckdata[0] : Chemistry $ckdata[$sort]%
EOM }else{ $combined2 .=<<"EOM";
$ckdata[0] : 相性 $ckdata[$sort]%
EOM } } } } sub mobilecheck{ if($ENV{'HTTP_USER_AGENT'} =~ /UP.Browser/i && $ENV{'HTTP_USER_AGENT'} !~ /Vodafone/i){ $mobile = 'e'; }elsif($ENV{'HTTP_USER_AGENT'} =~ /DoCoMo/i){ $mobile = 'i'; }elsif($ENV{'HTTP_USER_AGENT'} =~ /J-PHONE/i || $ENV{'HTTP_USER_AGENT'} =~ /Vodafone/i || $ENV{'HTTP_USER_AGENT'} =~ /SoftBank/i){ $mobile = 'v'; }elsif($ENV{'HTTP_USER_AGENT'} =~ /ASTEL/i || $ENV{'HTTP_USER_AGENT'} =~ /PDXGW/i || $ENV{'HTTP_USER_AGENT'} =~ /L-mode/i || $ENV{'HTTP_USER_AGENT'} =~ /DDIPOCKET/i || $ENV{'HTTP_USER_AGENT'} =~ /WILLCOM/i || $mobile){ if($mobile){ $mobile = $mobile; }else{ $mobile = 1; } } if($mobile eq 'e'){ $inputmoden = 'FORMAT=*N';#デフォルト数字入力属性 $inputmodea = 'FORMAT=*m';#デフォルト半角英文字入力属性 $emj[0] = '';#女性の顔 $emj[1] = '';#男性の顔 $emj[2] = '';#性格 $emj[3] = '';#性質 $emj[4] = '';#対人 $emj[5] = '';#恋愛 $emj[6] = '';#プラス $emj[7] = '';#ドクロ $emj[8]= '';#標準見出し $emj[9]= '';#干支 $emj[10]= '';#星 $emj[11]= '';#年 $emj[12]= '';#月 $emj[13]= '';#日 $emj[14] = '';#家 $emj[15] = '';#デコメ }elsif($mobile eq 'i'){ $mobile = "imode"; $inputmoden = 'istyle="4"';#デフォルト数字入力属性 $inputmodea = 'istyle="3"';#デフォルト半角英文字入力属性 $emj[0] = '';#女性の顔 $emj[1] = '';#男性の顔 $emj[2] = '';#性格 $emj[3] = '捻';#性質 $emj[4] = '鍊';#対人 $emj[5] = '璉';#恋愛 $emj[6] = '撚';#プラス $emj[7] = '念';#ドクロ $emj[8]= '';#標準見出し $emj[9]= '聾';#干支 $emj[10]= '';#星 $emj[11]= '丹';#年 $emj[12]= '弄';#月 $emj[13]= '';#日 $emj[14] = '';#家 $emj[15] = '亮';#デコメ }elsif($mobile eq 'v'){ $mobile = "vodafone"; $accesskey = 'directkey'; $inputmoden = 'mode="n"';#デフォルト数字入力属性 $inputmodea = 'mode="a"';#デフォルト半角英文字入力属性 $emj[0] = '$G%';#女性の顔 $emj[1] = '$G$';#男性の顔 $emj[2] = '$E4';#性格 $emj[3] = '$F!';#性質 $emj[4] = '$E)';#対人 $emj[5] = '$E1';#恋愛 $emj[6] = '$GB';#プラス $emj[7] = '$E<';#ドクロ $emj[8]= '$F9';#標準見出し $emj[9]= '$Gr';#干支 $emj[10]= '$F^';#星 $emj[11]= '$Gj';#年 $emj[12]= '$Gl';#月 $emj[13]= '$Gm';#日 $emj[14] = '$GV';#家 $emj[15] = '$E#';#デコメ } } sub getmobilead { if($kpsid){ my $url = "http://ads.keitaipremium.jp/?q=%90%E8%82%A2&h=$kpsid"; my $ua = LWP::UserAgent->new; my $req = HTTP::Request->new(GET=>$url); $req->header('Accept' => 'text/html','User_Agent' => "$ENV{'HTTP_USER_AGENT'}",); my $res = $ua->request( $req ); if ($res->is_success) { my $adhtml = $res->content; my @ads = split(/\n/, $adhtml); if($ads[0]){$ad1 = "[AD]$ads[0]
";} } } if($googleid){ $ad2 = &google_adsence; } if($croozsid){ my $hua = $ENV{'HTTP_USER_AGENT'}; $hua = &urlencode($hua); my $url = "http://adpage.crooz.jp/adpws/v1/?ptnid=$croozsid&url=http%3A%2F%2Fwww.a-uranai.com%2F&ip=$ENV{'REMOTE_ADDR'}&ua=$hua"; my $ua = LWP::UserAgent->new; my $req = HTTP::Request->new(GET=>$url); $req->header('Accept' => 'text/html','User_Agent' => "$ENV{'HTTP_USER_AGENT'}",); my $res = $ua->request( $req ); my $content; if ($res->is_success) { $content = $res->content; $content =~ s/\n//g; my $re = '(.*?)(.*?)(.*?)(.*?)'; while ($content =~ /$re/igo) { $ad2 = "[AD]$2
$3
"; } } } } sub matchsmart{ my $murllist; if($matchsmartid){ my $url = "http://cms.matchsmart.jp/xml/?id=$matchsmartid&ip=$ENV{'REMOTE_ADDR'}&algo=1&q=%E5%8D%A0%E3%81%84"; my $ua = LWP::UserAgent->new; $ua->timeout([1]); my $req = HTTP::Request->new(GET=>$url); $req->header('Accept' => 'text/html','User_Agent' => "$ENV{'HTTP_USER_AGENT'}",); my $res = $ua->request( $req ); my $content; if ($res->is_success) { $content = $res->content; $content =~ s/\n//g; my $re = '(.*?)(.*?)(.*?)(.*?)'; while ($content =~ /$re/igo) { $murllist .= <<"EOM";
  • $5
    $4 $6
  • EOM } } } return ($murllist); } sub brainer{ my $url = "http://ws.brainer.jp/ws?id=3511&email=abiru\@abistudio.com&type=word&dat=%E5%8D%A0%E3%81%84"; my $ua = LWP::UserAgent->new; $ua->timeout([1]); my $req = HTTP::Request->new(GET=>$url); $req->header('Accept' => 'text/html','User_Agent' => "$ENV{'HTTP_USER_AGENT'}",); my $res = $ua->request( $req ); my $content; my $murllist; if ($res->is_success) { $content = $res->content; $content =~ s/\n//g; Encode::from_to($content,"euc-jp","utf8"); # $content = decode('UTF-8',$content); my $re = '(.*?)(.*?)(.*?)'; while ($content =~ /$re/igo) { $murllist .= <<"EOM";
  • $2
    $3
  • EOM } } return ($murllist); } sub google_append_color { @color_array = split(/,/, $_[0]); return $color_array[$_[1] % @color_array]; } sub google_adsence { my $google_dt = sprintf("%.0f", 1000 * gettimeofday()); my $google_scheme = ($ENV{"HTTPS"} eq "on") ? "https://" : "http://"; my $google_host = uri_escape($google_scheme . $ENV{"HTTP_HOST"}); my $google_ad_url = "http://pagead2.googlesyndication.com/pagead/ads?" . "ad_type=text" . "&channel=7947514784" . "&client=ca-mb-pub-4504077977143546" . "&dt=" . $google_dt . "&format=mobile_single" . "&host=" . $google_host . "&ip=" . uri_escape($ENV{"REMOTE_ADDR"}) . "&markup=xhtml" . "&oe=sjis" . "&output=xhtml" . "&ref=" . uri_escape($ENV{"HTTP_REFERER"}) . "&url=" . $google_host . uri_escape($ENV{"REQUEST_URI"}) . "&useragent=" . uri_escape($ENV{"HTTP_USER_AGENT"}); my $murllist; my $ua = LWP::UserAgent->new; my $google_ad_output = $ua->get($google_ad_url); if ($google_ad_output->is_success) { $murllist = $google_ad_output->content; } return ($murllist); } sub decode{ my $cgi = new CGI; if($ENV{'PATH_INFO'}){ my $buffer = $ENV{'PATH_INFO'}; if (length($buffer) > 100){exit;} $buffer = substr($buffer,1); my @lens = split(/\//,$buffer); my %FORM; foreach my $len(@lens){ my ($name, $value) = split(/_/,$len,2); $FORM{$name} = $value; } $y = $FORM{'y'}; $m = $FORM{'m'}; $d = $FORM{'d'}; $blood = $FORM{'b'}; $s = $FORM{'s'}; $u = $FORM{'u'}; $p = $FORM{'p'}; $r = $FORM{'r'}; $e = $FORM{'e'}; $name = $FORM{'name'}; $type = $FORM{'type'}; $star = $FORM{'star'}; $com = $FORM{'com'}; $data = $FORM{'data'}; $del = $FORM{'del'}; $mobile = $FORM{'mobile'}; }else{ $y = $cgi->param('y'); $m = $cgi->param('m'); $d = $cgi->param('d'); $blood = $cgi->param('b'); $s = $cgi->param('s'); $u = $cgi->param('u'); $p = $cgi->param('p'); $r = $cgi->param('r'); $e = $cgi->param('e'); $name = $cgi->param('name'); $type = $cgi->param('type'); $star = $cgi->param('star'); $com = $cgi->param('com'); $data = $cgi->param('data'); $del = $cgi->param('del'); $mobile = $cgi->param('mobile'); $sample = $cgi->param('sample'); $xml = $cgi->param('xml'); $pass = $cgi->param('pass'); $no = $cgi->param('no'); } $y =~s/0/0/g; $y =~s/1/1/g; $y =~s/2/2/g; $y =~s/3/3/g; $y =~s/4/4/g; $y =~s/5/5/g; $y =~s/6/6/g; $y =~s/7/7/g; $y =~s/8/8/g; $y =~s/9/9/g; $m =~s/0/0/g; $m =~s/1/1/g; $m =~s/2/2/g; $m =~s/3/3/g; $m =~s/4/4/g; $m =~s/5/5/g; $m =~s/6/6/g; $m =~s/7/7/g; $m =~s/8/8/g; $m =~s/9/9/g; $d =~s/0/0/g; $d =~s/1/1/g; $d =~s/2/2/g; $d =~s/3/3/g; $d =~s/4/4/g; $d =~s/5/5/g; $d =~s/6/6/g; $d =~s/7/7/g; $d =~s/8/8/g; $d =~s/9/9/g; $name =~ s/\+/ /g; $baseurl = $cgi->url(-path_info, 1,-query, 1); ($baseurl,my $dmy) = split(/\/\/y/,$baseurl); $baseurl =~ s/\?/\//g; $baseurl =~ s/\=/\_/g; $baseurl =~ s/\;/\//g; if($baseurl !~ /\/$/){$baseurl .= '/';} $fullbaseurl = $baseurl; (my $dmy,$baseurl) = split(/.com\//,$baseurl); $baseurl = '/'.$baseurl; if(!$s){$s=0;} } sub set_cookie { my $times = time; my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($times + $cooksaveint*24*60*60); my @mon = ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'); my @week = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); my $gmtcook = sprintf("%s, %02d-%s-%04d %02d:%02d:%02d GMT", $week[$wday],$mday,$mon[$mon],$year+1900,$hour,$min,$sec); print "Set-Cookie: $cookname=$cook; expires=$gmtcook\n"; } sub get_cookie { my ($key, $val, @cook, %tmp); @cook = split(/;/, $ENV{'HTTP_COOKIE'}); foreach (@cook) { ($key, $val) = split(/=/); $key =~ s/\s//g; $tmp{$key} = $val; } @ck = split(/<>/, $tmp{"$cookname"}); foreach (@ck) { from_to($_,"shift-jis","utf8"); } my $nowcook = $tmp{"$cookname"}; $ckm = $#ck+1; } sub sort{ my %SData; my $in; for ($in=0; $in<=$#log; $in++){ &csvsplit($log[$in]); my @Buf = @values; $SData{$in} = $Buf[$sort]; } my @SortData = sort {($SData{$b} <=> $SData{$a}) || ($b cmp $a)} keys(%SData); @nlog = (); for ($in=0; $in<=$#SortData; $in++){ my $cl = $SortData[$in]; push(@nlog,$log[$cl]); } } sub star{ my ($val) = @_; if($val > 90){$val = 'star5.gif';$starsu = 5;} elsif($val > 80){$val = 'star4.gif';$starsu = 4;} elsif($val > 70){$val = 'star3.gif';$starsu = 3;} elsif($val > 60){$val = 'star2.gif';$starsu = 2;} elsif($val > 50){$val = 'star1.gif';$starsu = 1;} elsif($val > 40){$val = 'cross1.gif';$starsu = -1;} elsif($val > 30){$val = 'cross2.gif';$starsu = -2;} elsif($val > 20){$val = 'cross3.gif';$starsu = -3;} elsif($val > 9){$val = 'cross4.gif';$starsu = -4;} else{$val = 'cross5.gif';$starsu = -5;} return $val; } sub engmonth{ my ($val) = @_; if($val == 1){$val = 'January';} elsif($val == 2){$val = 'February';} elsif($val == 3){$val = 'March';} elsif($val == 4){$val = 'April';} elsif($val == 5){$val = 'May';} elsif($val == 6){$val = 'June';} elsif($val == 7){$val = 'July';} elsif($val == 8){$val = 'August';} elsif($val == 9){$val = 'September';} elsif($val == 10){$val = 'October';} elsif($val == 11){$val = 'November';} else{$val = 'December';} return $val; } sub csvsplit { my ($line) = @_; $line =~ s/(?:\x0D\x0A|[\x0D\x0A])?$/,/; @values = map {/^"(.*)"$/ ? scalar($_ = $1, s/""/"/g, $_) : $_} ($line =~ /("[^"]*(?:""[^"]*)*"|[^,]*),/g); } sub urlencode { my ($line) = @_; from_to($line,"utf8","shift-jis"); $line =~ s/([^ \w])/'%'.uc(unpack('H2',$1))/ge; $line =~ s/\s/+/g; $line; }