Google非公式天気予報API [Google Weather API] TEST

class googleWeatherApi

http://sige2000.s355.xrea.com/googleWeatherApi

| 対戦ゲーム | Class説明 | SJIS TEST |


対決させたい都市名を入力

例:[港区][東京都] or [札幌市][北海道] (都,道,府,県,市,区,町,村は省略不可)
例:[Minato][Tokyo] or [Sapporo] [Hokkaido](欧文の場合は省略可)
主要都市は2項目目を省略しても認識します。例:[Tokyo][] or [Sapporo][] (欧文のみ)
サンプル(札幌市)


以下のコードを表示したい場所へ貼付けてください。 サンプル(札幌市)

<script type="text/javascript" src="http://sige2000.s355.xrea.com/googleWeatherApi/googleWeatherApi.js"></script> <script type="text/javascript">googleWeatherApi( '' , '' , '' , '' , '' );</script>
引数内容初期値サンプル
$p1 都市名 stringNULLsapporo、札幌、札幌市
$p2 地域名 stringNULLhokkaido、北海道
$hl 国コード(言語)stringNULLjp
$htmlhtmlテンプレートstringNULLNull or 'simple' or 'today' or オリジナル(ただし改行はNG:以下のサンプル参照)
$lang文字コード stringNULLUTF8,SJIS など
戻り値内容
html成形済みHTMLソース

[ テンプレートのCSSサンプル ]

/*weather*/ html * #weather * {margin:0; padding:0; border:0;} #weather {width:190px; border:1px solid #00CCFF; float:left; font-size:100%;} #weather .header {margin:4px; padding:0 2px; border-bottom:1px dashed #999999;} #weather .bodyer {margin:4px;} #weather .footer {margin:8px 0 4px 4px; clear:both; font-size:70%;} #weather h3 {font-size:100%; font-weight:bold; margin:0;} #weather h3 span {font-size:100%;} #weather .image {float:left; width:50px; text-align:center; font-size:90%; font-weight:bold;} #weather .image img {margin:2px;} #weather .condition {float:left; margin:0 5px 0 10px;} #weather h5 {font-size:250%; margin:0} #weather h5 span {font-size:40%;} #weather p {color:#666666; margin:0; font-size:80%;} #weather ul {margin:0; padding:0;} #weather li {list-style-type:none; float:left; width:60px; text-align:center;} #weather span.low {color:#3333FF;} #weather span.high{color:#CC3300;}

[ テンプレートのHTMLサンプル ]

<div id="weather"> <div class="header"> <h3>{{fi/postal_code2}}{{fi/postal_code1}} <span>{{fi/month}}/{{fi/day}}</span></h3> </div> <div class="bodyer"> <div class="image"> {{cc/img_tag}}<br /> {{cc/condition}} </div> <div class="condition"> <h5>{{cc/temp_c}}<span>&#08451;</span></h5> <p>{{cc/humidity}}<br />{{cc/wind_condition}}</p> </div> </div> <div class="footer"> <ul> <li> {{fc:1/img_tag}}<br /> <strong>{{fc:1/month}}/{{fc:1/day}}</strong> <span class="high">{{fc:1/high}}</span>/<span class="low">{{fc:1/low}}</span> </li> <li> {{fc:2/img_tag}}<br /> <strong>{{fc:2/month}}/{{fc:2/day}}</strong> <span class="high">{{fc:2/high}}</span>/<span class="low">{{fc:2/low}}</span> </li> <li> {{fc:3/img_tag}}<br /> <strong>{{fc:3/month}}/{{fc:3/day}}</strong> <span class="high">{{fc:3/high}}</span>/<span class="low">{{fc:3/low}}</span> </li> </ul> </div> </div>