blog/content/post/2010/04/25/2010-04-25-00001355.md

70 lines
4.0 KiB
Markdown

---
title: WiLiKi で youtube 動画を表示するマクロ
author: kazu634
date: 2010-04-25
wordtwit_post_info:
- 'O:8:"stdClass":13:{s:6:"manual";b:0;s:11:"tweet_times";i:1;s:5:"delay";i:0;s:7:"enabled";i:1;s:10:"separation";s:2:"60";s:7:"version";s:3:"3.7";s:14:"tweet_template";b:0;s:6:"status";i:2;s:6:"result";a:0:{}s:13:"tweet_counter";i:2;s:13:"tweet_log_ids";a:1:{i:0;i:5239;}s:9:"hash_tags";a:0:{}s:8:"accounts";a:1:{i:0;s:7:"kazu634";}}'
categories:
- gauche
---
<div class="section">
<p>
作成しました。簡単にできちゃった。
</p>
<h4>
ソース
</h4>
<pre class="syntax-highlight">
<span class="synComment">;; youtube module</span>
<span class="synComment">;; [[$$youtube id]]</span>
<span class="synSpecial">(</span>select-module wiliki.macro<span class="synSpecial">)</span>
<span class="synSpecial">(</span>use wiliki<span class="synSpecial">)</span>
<span class="synSpecial">(</span>use wiliki.macro<span class="synSpecial">)</span>
<span class="synSpecial">(</span>define-reader-macro <span class="synSpecial">(</span>youtube id<span class="synSpecial">)</span>
<span class="synPreProc">`(</span><span class="synSpecial">(</span>center
<span class="synSpecial">(</span>object
<span class="synSpecial">(</span>@
<span class="synSpecial">(</span>width <span class="synConstant">&#34;660&#34;</span><span class="synSpecial">)</span>
<span class="synSpecial">(</span>height <span class="synConstant">&#34;525&#34;</span><span class="synSpecial">))</span>
<span class="synSpecial">(</span>param
<span class="synSpecial">(</span>@
<span class="synSpecial">(</span>name <span class="synConstant">&#34;movie&#34;</span><span class="synSpecial">)</span>
<span class="synSpecial">(</span>value
,<span class="synSpecial">(</span>string-append
<span class="synConstant">&#34;http://www.youtube.com/v/&#34;</span>
id
<span class="synConstant">&#34;&#38;hl=ja_JP&#38;fs=1&#38;rel=0&#38;border=1&#34;</span><span class="synSpecial">))))</span>
<span class="synSpecial">(</span>param
<span class="synSpecial">(</span>@
<span class="synSpecial">(</span>name <span class="synConstant">&#34;allowFullScreen&#34;</span><span class="synSpecial">)</span>
<span class="synSpecial">(</span>value <span class="synConstant">&#34;true&#34;</span><span class="synSpecial">)))</span>
<span class="synSpecial">(</span>param
<span class="synSpecial">(</span>@
<span class="synSpecial">(</span>name <span class="synConstant">&#34;allowscriptaccess&#34;</span><span class="synSpecial">)</span>
<span class="synSpecial">(</span>value <span class="synConstant">&#34;always&#34;</span><span class="synSpecial">)))</span>
<span class="synSpecial">(</span>embed
<span class="synSpecial">(</span>@
<span class="synSpecial">(</span>src
,<span class="synSpecial">(</span>string-append
<span class="synConstant">&#34;http://www.youtube.com/v/&#34;</span>
id
<span class="synConstant">&#34;&#38;hl=ja_JP&#38;fs=1&#38;rel=0&#38;border=1&#34;</span><span class="synSpecial">))</span>
<span class="synSpecial">(</span><span class="synStatement">type</span> <span class="synConstant">&#34;application/x-shockwave-flash&#34;</span><span class="synSpecial">)</span>
<span class="synSpecial">(</span>allowscriptaccess <span class="synConstant">&#34;always&#34;</span><span class="synSpecial">)</span>
<span class="synSpecial">(</span>allowfullscreen <span class="synConstant">&#34;true&#34;</span><span class="synSpecial">)</span>
<span class="synSpecial">(</span>width <span class="synConstant">&#34;660&#34;</span><span class="synSpecial">)</span>
<span class="synSpecial">(</span>height <span class="synConstant">&#34;525&#34;</span><span class="synSpecial">)))))</span><span class="synPreProc">)</span><span class="synSpecial">)</span>
</pre>
<h4>
実行例
</h4>
<p>
<a href="http://simoom634.sakura.ne.jp/wiliki/wiliki.cgi?WiLiKi%3aYoutube%E3%83%9E%E3%82%AF%E3%83%AD" onclick="__gaTracker('send', 'event', 'outbound-article', 'http://simoom634.sakura.ne.jp/wiliki/wiliki.cgi?WiLiKi%3aYoutube%E3%83%9E%E3%82%AF%E3%83%AD', 'no title');" target="_blank">no title</a>」をご覧ください。
</p>
</div>