WordPressで作る世界遺産サイト
TickleCode. Yoshinori Kobayashi
1
WordPressもくもく勉強会 at コエド第5回 15.03.08
Weather Underground Plugin を活用して、 世界の天気予報を表示 編
生まれは 奈良県 です。
2
小林由憲(こばやしよしのり)
Twitter: @AsbyuKobayashi
ブログ: In Advance Only
3
最初にデモします。
http://www.world-ht.net/archives/worldheritage/machu-picchu マチュ・ピチュ。インカ時代に繁栄し、そして忘れ去れた「空中都市」
http://www.world-ht.net/archives/worldheritage/mont-saint-michel モン・サン=ミシェル。「西洋の驚異」と称される海に浮かぶ修道院
http://www.world-ht.net/archives/worldheritage/uluru-kata-tjuta-national-park ウルル=カタ・ジュタ国立公園。地球のへそと呼ばれる神秘な聖地
4
Weather Underground Plugin https://wordpress.org/plugins/wunderground/
5
Weather Underground Pluginの天気予報表示イメージ
6
http://www.wunderground.com/
Weather Underground という「天気サービス」を、 WordPress Plugin で提供したもの
7
複数の表示パターン
8
http://www.wunderground.com/weather/api/d/docs?d=language-support&MR=1
非常にたくさんの多言語に対応している
9
ShortCode(ショートコード)が使える ※投稿記事の内容ごとに天気予報を表示できる
echo do_shortcode(‘[wunderground location="Paris, France"]’); テンプレート(テーマ)に埋め込むときは、 do_shortcode で。
https://github.com/katzwebservices/Wunderground#shortcode Shortcode
10
地域名もしくは位置情報から天気予報を取得
[wunderground location="Denver, Colorado"]
[wunderground location=“Japan,Tokyo”]
City / State
Country / City
Coordinates(座標) latitude (緯度)/ longitude(経度) [wunderground location=“-25.3432835, 131.0412097”]
11
天気予報に必要なデータ要素が揃っている。
icon :天気アイコン
daynames :曜日
pop: 降水量
text:天気予報のコメント
https://github.com/katzwebservices/Wunderground#shortcode-parameters
date:日付
conditions:天候
highlow:最高気温、最低気温
Shortcode Parameters
12
最後に感想!
Weather Underground Plugin を入れて、 ショートコードを書いてほぼできる。
世界の天気予報を簡単にサイトへ導入できる!
ご清聴ありがとうございました。