2006-12-02 Sat
「よかった探しリース」 chalowプラグイン
- Summary
「よかった探しリース」[2006-12-02-5]のためのchalowプラグイン
### よかった探しリース # usage: {{hyuki_wreath('id')}} sub hyuki_wreath { my ($id) = @_; my $prefix = 'http://www.hyuki.com/ring/ring.cgi'; my $left = $prefix.'?mycmd=left&myid='.$id; my $right = $prefix.'?mycmd=right&myid='.$id; return qq( <a href="$left">左手</a> <a href="$prefix">よかった探しリース</a> <a href="$right">右手</a> ); }
2006-11-30 Thu
Smarty chalowプラグイン
- Source
### Smarty # usage: {{smarty('検索語')}} sub smarty { my ($str) = @_; my $prefix = 'http://smarty.php.net/manual/en/search.php?query='; my $enc = url_encode($str); return qq(<a href="$prefix$enc">$str</a>); }
- Reference
http://smarty.php.net/manual/en/search.php?query=keyword
2006-06-17 Sat
chalowでChangeLogのエントリを書いた時間をRSSフィードに反映するhack
- Reference
[O] chalowでChangeLogのエントリを書いた時間をRSSフィードに反映するhack
http://overlasting.dyndns.org/2006-06-14-2.html
- via
読書記録ChangeLog - 2006-06-15
http://dkiroku.com/2006-06-15-19.html
2006-03-02 Thu
勝手に ALPSLAB clip! for chalow - ALPSLAB clip! の chalow 用プラグイン
- Summary
以下の記述で地図が挿入できる.
{{alps_map('東京都新宿区西新宿2-8-1')}} {{alps_map('35/41/10.574,139/41/41.787')}} {{alps_map('東京都新宿区西新宿2-8-1','LN')}}
- Sample
- オプション
サイズ指定
| L | 480 x 360 |
| M | 320 x 240 (デフォルト) |
| S | 240 x 180 |
縮尺指定
| D | 詳細 最大縮尺 (デフォルト) |
| N | 中域 (25000階層) |
| W | 広域 (250000階層) |
- プラグインの alias
sub maps_image{alps_map(@_)}
- Reference
勝手に ALPSLAB clips! for chalow
http://www.kunitake.org/chalow/alps-chalow_pl.txt
ALPSLAB clip!
http://www.alpslab.jp/clip.html
戯れ言 / 2006-02-28
http://www.kunitake.org/chalow/2006-02-28.html#2006-02-28-2
- via
/home/pochi/ChangeLog - 2006-03-01 - ALPSLAB clip! の Chalow 用プラグイン
http://www.pochi.cc/~sasaki/chalow/2006-03-01-1.html
読書記録ChangeLog - 2006-03-01
http://dkiroku.com/2006-03-01-14.html
2006-02-15 Wed
chalow でキーボードタグを利用するプラグイン
- Source
### キーボード # usage: {{keyboard('Ctrl','Alt','Del')}} sub keyboard { @result = map {'<kbd>'.$_.'</kbd>'} @_; return join('+',@result); }
CSSを使ってキーボード入力をアイコンのように表示[2006-01-19-6] と組み合わせると良い.
kbd { color: #333333; background-color: white; text-align: center; border-left: 1px solid #cfcfcf; border-top: 1px solid #cfcfcf; border-right: 2px solid #666666; border-bottom: 2px solid #666666; -moz-border-radius: 4px 4px 4px 4px; padding-left: 2px; padding-top: 1px; padding-right: 3px; padding-bottom: 1px; margin-left: 2px; margin-right: 2px; margin-top: 1px; margin-bottom: 1px; vertical-align: middle; font-family: sans-serif; }
- Sample
Ctrl+Alt+Del
2006-02-08 Wed
chalow の 駅前探検倶楽部へのリンクプラグイン
- Summary
紹介した店の最寄駅までの乗り換えを簡単に調べられるようにしたい.
駅前探検倶楽部の「下車駅」に引数を入力するプラグインを作成.
- Source
### 駅前探検倶楽部へのリンク # usage: {{ekitan('中板橋')}} sub ekitan { my ($str) = @_; my $prefix = q(http://www8.ekitan.com/norikae/Norikae1Servlet?ST=); my $enc = Jcode->new($str)->sjis; $enc =~ s/([^0-9a-z_ ])/'%'.unpack('H2', $1)/gei; $enc =~ s/\s/+/g; return qq(<a href="$prefix$enc" title="駅探検索 - $str着">$str</a>); } sub station {ekitan(@_)}
- Sample
中板橋
板橋本町
2006-01-10 Tue
Google画像検索 chalow プラグイン
### Google 画像検索へのリンクプラグイン # usage: {{google_image('keyword')}} sub google_image { my ($str) = @_; my $prefix = q(http://images.google.com/images?q=); my $enc = Jcode->new($str)->utf8; $enc =~ s/([^0-9a-z_ ])/'%'.unpack('H2', $1)/gei; $enc =~ s/\s/+/g; return qq(<a href="$prefix$enc" title="Google Images - $str">Google 画像検索 - $str</a>); }
2005-12-29 Thu
chalow のプラグインを容易に移行するには
- Summary
地図サービスへのリンクの切り替えが面倒.
今回は MapionBB プラグインから Google Maps プラグインへの切り替え.
s/{{mapion/{{google_maps/g
- 解決方法
地図サービスへのリンクプラグインの名前をラッピングする.
mapを地図サービスへのリンクとして利用.
mapプラグイン内で実際の地図サービスプラグインを呼び出す.
sub maps {mapion(@_)}
から
sub maps {google_maps(@_)}
に変更するだけで良くなる.
2005-12-29 Thu
chalow の Google Maps へのリンクプラグイン
- Reference
### Google ローカルへのリンク # usage: {{google_map('東京都○○区○町00-0')}} sub google_map { my ($str) = @_; my $prefix = q(http://maps.google.co.jp); my $enc = Jcode->new($str)->utf8; $enc =~ s/([^0-9a-z_ ])/'%'.unpack('H2', $1)/gei; $enc =~ s/\s/+/g; return qq(<a href="$prefix/maps?q=$enc" title="Google ローカル - $str">$str</a>); }
2005-12-23 Fri
chalow Google Video Search Plug-in
2005-12-17 Sat
chalowで画像ポップアップ
- Summary
クリックしたらサムネイルの画像を拡大するようにした.
- 大きな画像をポップアップ [2005-09-28-5] のJavaScriptを popupImage.jsというファイルで保存して,各ページに<script>タグを埋め込む.
<script src="popupImage.js" type="text/javascript"></script>
- chalowファイルの get_link_str の中を変更
sub get_link_str { my ($a, $b) = @_; if ($a =~ /\.(jpg|jpeg|png|gif)$/i) { # [[http://nais.to/|image/nais.jpg]] # return qq(<a href="$b"><img src="$a" alt="画像" /></a>); return qq(<img src="$a" alt="クリックして拡大" onclick="popupImage('$b')" /><a href="$b">.</a>); } elsif ($b =~ /\.(jpg|jpeg|png|gif)$/i) { # [[自画像|image/sp.jpg]] return qq(<img src="$b" alt="$a" />); } else { # [[トップページ|http://nais.to/]] return qq(<a href="$b">$a</a>); } }
- Reference
オブジェクト指向JavaScript - 大きな画像をポップアップ
http://web.paulownia.jp/script/sample/popup.html
2005-12-17 Sat
chalow Google Music Search Plug-in
2005-07-14 Thu
chalow Google Local Plug-in
- Source
### Google Local Plug-in # usage: {{google_local('what','where')}} sub google_local { my ($what,$where) = @_; my $prefix = q(http://local.google.co.jp); my $what_enc = q(); $what_enc = Jcode->new($what)->utf8; $what_enc =~ s/([^0-9a-z_ ])/'%'.unpack('H2', $1)/gei; $what_enc =~ s/\s/+/g; my $where_enc = q(); $where_enc = Jcode->new($where)->utf8; $where_enc =~ s/([^0-9a-z_ ])/'%'.unpack('H2', $1)/gei; $where_enc =~ s/\s/+/g; my $ret = qq(<a href="$prefix/local?q=$what_enc&near=$where_enc" title="Google Local - $where の $what">); $ret .= qq(Google Local - $where の $what); $ret .= qq(</a>); return $ret; }
2005-03-10 Thu
chalow XML/SWF Charts Plug-in
- Summary
chalow から XML/SWF Charts[2005-03-10-6] を呼び出す Plug-in.
- Plug-in
### XML/SWF Charts Plug-in # usage: {{chart('XML File','width','height','bgcolor')}} sub chart { my ($xml,$width,$height,$bgcolor) = @_; my $charts = q(http://example.com/path/to/charts.swf); $ret = << "__CHARTHTML__" <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="$width" height="$height" id="charts" align="" > <param name=movie value="$charts?xml_source=$xml"> <param name=quality value="high"> <param name=bgcolor value="$bgcolor"> <embed src="$charts?xml_source=$xml" quality="high" bgcolor="$bgcolor" width="$width" height="$height" name="charts" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" > </embed> </object> __CHARTHTML__ ; return qq($ret); }
- Test (XML)
2005-02-19 Sat
Amazon の画像置換
- Summary
chalow で Amazon の画像置換を利用してみる.
- amazon.js
function replaceImage(img) { if (img.width == '1' && img.src.match(/\.01\./)) { img.src = 'http://images-jp.amazon.com/images/G/09/x-locale/detail/thumb-no-image.gif'; img.width = 98; img.height = 140; } else if (img.width == '1') { img.src = img.src.replace('.09.','.01.'); } }
- cl.conf
- 各 head タグ内に記述
<script src="path/to/amazon.js" type="text/javascript"></script>
- amazon リンクの作成プラグインを変更
<img src="/path/to/image" onload="replaceImage(this)" />- Reference
hail2u.net - 2004-05-30 - Amazon の画像置換 #2
http://hail2u.net/blog/coding/air_2.html
2005-02-06 Sun
画像タイトル付き Amazonリンクの作成
- Summary
あれこれポップアップ[2003-11-05-7]でAmazonへのリンクをポップアップしたい.
<img> タグに title 属性を付加した.
- Source
### amazon リンクの作成 (画像タイトル付き) # usage: {{amazon_image('ASIN', 'Title', 'num')}} sub amazon_image { my ($asin, $title, $num) = @_; my $prefix = "http://amazon.co.jp/o/ASIN"; my $suffix = "xight-22/ref=nosim"; # アソシID使用時 my $prefix2 = "http://images-jp.amazon.com/images/P"; my $suffix2 = "MZZZZZZZ.jpg"; if ($num ne '01'){ $num = '09'; } return qq(<a href="$prefix/$asin/$suffix" title="$title"><img src="$prefix2/$asin.$num.$suffix2" title="$title" /></a>); }
2005-02-02 Wed
Microsoft ダウンロードセンターへのリンクプラグイン
### Microsoft ダウンロードセンター へのリンクプラグイン # usage: {{msdc('FamilyID','word')}} sub msdc { my ($id,$str) = @_; my $prefix = q(http://www.microsoft.com/downloads/details.aspx); my $lang = q(ja); return qq(<a href="$prefix?displaylang=$lang&FamilyID=$id" title="Microsoftダウンロードセンター - $str">Microsoftダウンロードセンター - $str</a>); } ### Microsoft ダウンロードセンター への検索リンクプラグイン # usage: {{msdc_search('word')}} sub msdc_search { my ($str) = @_; my $prefix = q(http://www.microsoft.com/downloads/results.aspx); my $lang = q(ja); my $enc = Jcode->new($str)->utf8; $enc =~ s/([^0-9a-z_ ])/'%'.unpack('H2', $1)/gei; $enc =~ s/\s/+/g; return qq(<a href="$prefix?displaylang=$lang&freeText=$enc" title="Microsoftダウンロードセンター検索 - $str">Microsoftダウンロードセンター検索 - $str</a>); }
2005-01-28 Fri
Wikipedia へのリンクプラグイン
- Wikipedia へのリンクプラグイン [2005-11-27]改良
### Wikipedia へのリンクプラグイン # usage: {{wikipedia('word','country')}} sub wikipedia { my $default = 'ja'; my ($str,$country) = @_; if (!defined($country)){ $country = $default; } my $prefix = qq(http://$country.wikipedia.org/wiki); my $enc = Jcode->new($str)->utf8; $enc =~ s/([^0-9a-z_ ])/'%'.unpack('H2', $1)/gei; $enc =~ s/\s/+/g; return qq(<a href="$prefix/$enc" title="Wikipedia ($country) - $str">Wikipedia - $str</a>); }
- 旧
### Wikipedia へのリンクプラグイン # usage: {{wikipedia('word')}} sub wikipedia { my ($str) = @_; my $prefix = q(http://ja.wikipedia.org/wiki); my $enc = Jcode->new($str)->utf8; $enc =~ s/([^0-9a-z_ ])/'%'.unpack('H2', $1)/gei; $enc =~ s/\s/+/g; return qq(<a href="$prefix/$enc" title="Wikipedia - $str">Wikipedia - $str</a>); }