Weather Informationの追加
はやっている?お天気マークをつける方法
ネタ元はこちらです
■ZWeatherAppletのインストール
1.ここからダウンロードします。
2.tar -zxvf より zope/インスタンス/Products内へ解凍
■PyMETARのインストール
1.ここからダウンロード。意味もなくバージョン0.5を選びました。<=どこかで0.6以上は↑が動作しないと書いてあったので。
2.tar -zxvf より 解凍
3.python setip.py install よりPythonへインストール
ZOPEの再起動必要!
■COREBlogWeatherPlugin01a.tgzのインストール
1.ここからダウンロード
2.tar -zxvf より zope/インスタンス/Products内へ解凍
■ZOPEを再起動
/zope/インスタンス/bin から ./zopectrl restart
■プロダクトをZOPE/Ploneへ追加
・COREBlogの "Contents" 内で "ZWeatherApplet" プロダクトを追加
Id : Weather
Title : Weather
Station Location Code : ここには英文字4文字のコードが入ります。
・COREBlogの "Contents" 内で "COREBlogWeatherPlugin" プロダクトを追加
Id: weather_plugin
■ファイルを設定
・COREBlogの "methods" 内に Script(Python) プロダクト(ファイル?)を追加
Id:addEntryHook
Parameter:d
・COREBlogの "Contents" 内で "DTML Method"を追加
Id:gettenki
ファイル内容
<dtml-try>
<dtml-if "weather_plugin.getWeather(entry.id) is None">
<dtml-else>
|東京 <img src="<dtml-var "weather_plugin.getWeather(entry.id)">"
style="float: none;margin: 0 0em 0em 0;margin-left: 0;
margin-right:0;vertical-align:middle;">|
</dtml-if>
<dtml-except>
</dtml-try>
・追加したい箇所に以下を挿入
<span tal:replace="structure here/gettenki" />



