/*

tenki.jp VC\ 1.1

*/

// \n̐ݒ
// CITY.txt Qlɂāucity =  ;v̐w肵܂
city = 63 ;

Memo.title='tenki.jp VC\';
Memo.width=295;
Memo.height=185;

http = new HTTP;
var s = new Array();
s=http.get('http://tenki.jp/forecast/city-'+city+'.html');

html = new Strings();
  html.add('<html><head><meta http-equiv="Content-Type" content="text/html; charset=shift_jis"></head>');
  html.add('<style type="text/css"><!-- body {margin: 2; padding: 0; overflow: hidden;} table, td {font-size: 90%; border:1px #cccccc solid; border-collapse: collapse; padding: 1px; text-align: center; vertical-align:middle;} --></style>');
  html.add('<body link="#4C617C" text="#666666"><basefont size=2>');

s=s.fromUTF8toSJIS();

s.match(/<h1>(.*?)̓VC<\/h1>.*?N([0-9]+.*?)/m);
 chiiki=RegExp.$1; happyou=RegExp.$2;
  html.add('<a href="http://tenki.jp/forecast/city-'+ city +'.html" target=_blank title="tenki.jpi{Cۋj"><b>' +chiiki+ '</a></b>@@<small>' +happyou+ ' \</small><br>');

  html.add('<table width=280><tr><td></td><td>VC</td><td>Œ/ō</td><td width=34>0-6</td><td width=34>6-12</td><td width=34>12-18</td><td width=34>18-24</td></tr>');

s.match(/<!-- #townLeftOneBox -->(.*?)<!-- \/#townLeftOneBox -->/m);
 kyou=RegExp.$1;
kyou.match(/[1|2|3|4|5|6|7|8|9|10|11|12]([0-9]+)\((.*?)\)/m);
 hiduke=RegExp.$1; youbi=RegExp.$2;
kyou.match(/weatherIcon.*?(<img .*?>)/m);
 gazou=RegExp.$1.replace(/width="47" height="30"/gm,'height="15"');
kyou.match(/>ō.*?(-?[0-9]+|---)/m);
 saikou=RegExp.$1;
kyou.match(/>Œ.*?(-?[0-9]+|---)/m);
 saitei=RegExp.$1;
kyou.match(/>~m.*?(<td.*?)<\/tr>/m);
 kousui=RegExp.$1.replace(/%/gm,'');
  html.add('<tr><td>'+hiduke+'('+youbi+')</td><td>'+gazou+'</td><td><font color=blue>'+saitei+'</font> / <font color=red>'+saikou+'</font></td>'+kousui+'</tr>');

s.match(/<div id="townRightOneBox">(.*?)<!-- \/#townROneBox -->/m);
 asu=RegExp.$1;
asu.match(/[1|2|3|4|5|6|7|8|9|10|11|12]([0-9]+)\((.*?)\)/m);
 hiduke=RegExp.$1; youbi=RegExp.$2;
asu.match(/weatherIcon.*?(<img .*?>)/m);
 gazou=RegExp.$1.replace(/width="47" height="30"/gm,'height="15"');
asu.match(/>ō.*?(-?[0-9]+|---)/m);
 saikou=RegExp.$1;
asu.match(/>Œ.*?(-?[0-9]+|---)/m);
 saitei=RegExp.$1;
asu.match(/>~m.*?(<td.*?)<\/tr>/m);
 kousui=RegExp.$1.replace(/%/gm,'');
  html.add('<tr><td>'+hiduke+'('+youbi+')</td><td>'+gazou+'</td><td><font color=blue>'+saitei+'</font> / <font color=red>'+saikou+'</font></td>'+kousui+'</tr>');

  html.add('</table>');
  html.add('<small>@</small><table width=280>');

s.match(/<th abbr="t" class="citydate">.*?(<td.*?)<\/tr>/m);
whiduke=RegExp.$1.replace(/1|2|3|4|5|6|7|8|9|10|11|12/gm,'') //[0-9]+A[1-12]3Ƀ}b`Ȃ̂
                 .replace(/([0-9]).*?\(/gm,'$1\(')
                 .replace(/\).*?<\/td>/gm,'\)<\/td>');
  html.add('<tr><td></td>'+whiduke+'</tr>');

s.match(/<th abbr="VC" class="shipsInfo">.*?(<td.*?)<\/tr>/m);
wtenki=RegExp.$1.replace(/width="47" height="30"/gm,'height="15"')
                .replace(/<p>.*?<\/p>/gm,'');
  html.add('<tr><td>VC</td>'+wtenki+'</tr>');

s.match(/<th abbr="Cij" class="shipsInfo">.*?(<td.*?)<\/tr>/m);
wkion=RegExp.$1.replace(/<p class="weeklyHighTemp">(.*?)<\/p>/gm,'<font color=red>$1<\/font><br>')
               .replace(/<p class="weeklyLowTemp">(.*?)<\/p>/gm,'<font color=blue>$1<\/font>');
  html.add('<tr><td>C</td>'+wkion+'</tr>');

s.match(/<th abbr="~mi%j" class="shipsInfo">.*?(<td.*?)<\/tr>/m);
wkousui=RegExp.$1;
  html.add('<tr><td>~m</td>'+wkousui+'</tr>');

  html.add('</table>');
  html.add('</body></html>');

	html.saveToFile('~'+Memo.id+'_temp.html');
	Memo.ShowAsHtmlOnIE('~'+Memo.id+'_temp.html');
