<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    
    <title>Nikep's blog - 開発</title>
    <link>http://www.nikep.net/srdpty/</link>
    <description>Interests about Software, Developement, Technologies and Hobbies...</description>
    <dc:language>ja</dc:language>
    <generator>Serendipity 1.6.2 - http://www.s9y.org/</generator>
    <pubDate>Sat, 15 Jun 2013 17:14:23 GMT</pubDate>

    <image>
        <url>http://www.nikep.net/srdpty/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Nikep's blog - 開発 - Interests about Software, Developement, Technologies and Hobbies...</title>
        <link>http://www.nikep.net/srdpty/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>iOS: add parameters on file URL in NSURL for UIWebView</title>
    <link>http://www.nikep.net/srdpty/index.php?/archives/88-iOS-add-parameters-on-file-URL-in-NSURL-for-UIWebView.html</link>
            <category>開発</category>
    
    <comments>http://www.nikep.net/srdpty/index.php?/archives/88-iOS-add-parameters-on-file-URL-in-NSURL-for-UIWebView.html#comments</comments>
    <wfw:comment>http://www.nikep.net/srdpty/wfwcomment.php?cid=88</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.nikep.net/srdpty/rss.php?version=2.0&amp;type=comments&amp;cid=88</wfw:commentRss>
    

    <author>nospam@example.com (金子 恵季)</author>
    <content:encoded>
    &lt;br /&gt;
&lt;h2&gt;NSURL refuses to add parameters&lt;/h2&gt;&lt;p&gt;When using UIWebView, we prepare the URL of the contents as NSURL. In case of which the contents are local files and we want to add parameter like &amp;quot;info.html?param1=val1&amp;amp;param2=val2&amp;quot;, there should be a special way to make NSURL. I&#039;d like to explain how it is.&lt;/p&gt;&lt;p&gt;In case of local files, the normal way is using NSURL::fileURLWithPath. But loading is failed with NSURL which is made by fileURLWithPath from local file path combined with parameters. So we should use URLWithString method. But it fails again and it may be caused by malform of the path. After some trials I found that the path string should be escaped before URLWithString although we can use a plain text path string with fileURLWithPath.&lt;/p&gt;&lt;p&gt;The final code of getting NSURL from file URL with parameters.&lt;/p&gt;&lt;blockquote&gt;&lt;pre&gt;NSString path = [[NSBundle mainBundle] pathForResources:fileBase ofType:@&amp;quot;html&amp;quot;];&lt;br /&gt;NSString prms = [NSString stringWithFormat:@&amp;quot;?%@=%@&amp;amp;%@=%@&amp;quot;,key1,val1,key2,val2];&lt;br /&gt;path = [path stringByAppendingString:prms];&lt;br /&gt;NSString urlstr = [[NSString stringWithFormat:@&amp;quot;file://localhost/%@&amp;quot;,path] &lt;br /&gt;                             stringByAddingPercentEscapesUsingEncoding:NSUTF8String];&lt;br /&gt;NSURL url = [NSURL URLWithString urlstr];&lt;br /&gt;[webView loadRequest:[NSURLRequest requestWithURL:url];&lt;/pre&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/p&gt;&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Sun, 16 Jun 2013 01:45:43 +0900</pubDate>
    <guid isPermaLink="false">http://www.nikep.net/srdpty/index.php?/archives/88-guid.html</guid>
    
</item>
<item>
    <title>iOS/iPhone開発小技</title>
    <link>http://www.nikep.net/srdpty/index.php?/archives/86-iOSiPhone.html</link>
            <category>開発</category>
    
    <comments>http://www.nikep.net/srdpty/index.php?/archives/86-iOSiPhone.html#comments</comments>
    <wfw:comment>http://www.nikep.net/srdpty/wfwcomment.php?cid=86</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.nikep.net/srdpty/rss.php?version=2.0&amp;type=comments&amp;cid=86</wfw:commentRss>
    

    <author>nospam@example.com (金子 恵季)</author>
    <content:encoded>
    &lt;br /&gt;
&lt;p align=&quot;justify&quot;&gt;ここ暫く、常駐でiPhoneアプリの開発をしてきました。他人のアプリ開発をすると、想定外の機能や仕様を実装することになることがしばしばです。そうすると、知らなかったやり方を調べたり考案したりしなくてはならず、勉強になることも多いです。この過程で分った、iOS開発のtipsを紹介して行きます。&lt;/p&gt;&lt;h1 align=&quot;justify&quot;&gt;iOSアプリのスレッドの扱い&lt;/h1&gt;&lt;p align=&quot;justify&quot;&gt;iOSの開発では、通常はスレッドを意識する必要はありません。基本的には、システムから呼ばれる(例えばViewController Class等の)メソッドを実装するわけですが、これらは、殆どMainThreadで動きます。また、非同期APIなどでは、システムが適宜スレッドを分けて実行してくれるからです。しかし、UIActionIndicaterを使うときなどで、例えばUIWebViewのデリゲートが別スレッドから呼ばれるのに気づいたります。&lt;/p&gt;&lt;h2&gt;新たに別スレッドを上げて、非同期に実行する&lt;/h2&gt;&lt;div align=&quot;justify&quot;&gt;&lt;p&gt;iOSでは、コールバックとして呼ばれたメインスレッドを止めてしまうことはできませんので、重い処理や、待ちを入れないとならない処理は、別スレッドで実行する必要があります。これは、以下のように、doInTheOtherThreadメソッドを作成して呼出します。このとき、別スレッドのメソッドは、メモリプールを別に取らないとならないようで&lt;/p&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;p&gt;&lt;code class=&quot;prettyprint&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&lt;/span&gt;&lt;font face=&quot;arial,helvetica,sans-serif&quot;&gt;&lt;i&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; performSelectorInBackground&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;@selector&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;doInTheOtherThread&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; withObject&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;paramObj];&lt;/span&gt;&lt;/i&gt;&lt;span class=&quot;pun&quot;&gt;&lt;/span&gt;&lt;/font&gt;&lt;/code&gt;&lt;font face=&quot;arial,helvetica,sans-serif&quot;&gt;&lt;code class=&quot;prettyprint&quot;&gt;&lt;/code&gt;&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;div align=&quot;justify&quot;&gt;&lt;pre&gt;&lt;font face=&quot;arial,helvetica,sans-serif&quot;&gt;&lt;code class=&quot;prettyprint&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&lt;/span&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;&lt;div align=&quot;left&quot;&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;font face=&quot;arial,helvetica,sans-serif&quot;&gt;&lt;i&gt;......;&lt;/i&gt;&lt;/font&gt;&lt;/pre&gt;&lt;pre&gt;&lt;font face=&quot;arial,helvetica,sans-serif&quot;&gt;&lt;i&gt;&lt;code class=&quot;prettyprint&quot;&gt;&lt;span class=&quot;pun&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;prettyprint&quot;&gt;&lt;span class=&quot;pln&quot;&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;prettyprint&quot;&gt;&lt;span class=&quot;pln&quot;&gt;doInTheOtherThread:(id)paramObj  &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;/span&gt;&lt;span class=&quot;com&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;NSAutoreleasePool&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;pool&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[[&lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;NSAutoreleasePool&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; alloc&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; init&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;];&lt;br /&gt;    if (pool == nil) return;&lt;br /&gt;    .....;&lt;/span&gt;&lt;/code&gt;&lt;/i&gt;&lt;i&gt;&lt;code class=&quot;prettyprint&quot;&gt;&lt;span class=&quot;pun&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;pool drain&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;];&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&lt;br /&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/i&gt;&lt;/font&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2&gt;別スレッドから、メインスレッドとして実行する&lt;/h2&gt;&lt;p align=&quot;justify&quot;&gt;処理は別スレッドで行った場合で、一部の処理をメインスレッドで実行したい場合です。特に、UIメッセージはメインスレッドから発行しないとなりませんので、この目的で頻繁に使います。この場合は、当該処理をメソッドに分けて、メインスレッドのコンテキストで実行します。&lt;/p&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;i&gt;&lt;font face=&quot;times new roman,times,serif&quot;&gt;[NSObject performSelectorOnMainThread:doInTheMainThread withObject:paramObj waitUntilDone:YES]; &lt;/font&gt;&lt;/i&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;p align=&quot;justify&quot; /&gt;&lt;h2&gt;メインスレッドで一時的に待ちを入れる&lt;/h2&gt;&lt;p align=&quot;justify&quot;&gt;メインスレッドはメソッド内部で待ちに入ることはできない(再開できなくなります)のですが、RunLoopに戻って実行を遅延させることはできます。これは、例えばUIActionIndicatorの表示をする際に使うことができます。(これを使わない限り、startAnimationとstopAnimationを一つの関数の中で実行しても、表示されません)&lt;/p&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;i&gt;&lt;font face=&quot;times new roman,times,serif&quot;&gt;[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.0f]];&lt;/font&gt;&lt;/i&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;p align=&quot;left&quot; /&gt;&lt;p align=&quot;justify&quot; /&gt;&lt;h2&gt;非メインスレッドで同期する&lt;/h2&gt;&lt;p align=&quot;justify&quot;&gt;メインスレッドでなければ、mutexで待合わせることは可能です。例えば、以下のようなコードになります。この場合は、2回目のlockでウェイトします。&lt;/p&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;i&gt;&lt;font face=&quot;times new roman,times,serif&quot;&gt;MethodRunOnThread1 {&lt;br /&gt;  pthread_mutex_init(&amp;amp;mutex, &amp;amp;attr);&lt;br /&gt;  pthread_mutex_lock(&amp;amp;mutex);&lt;br /&gt;&lt;font size=&quot;2&quot; face=&quot;times new roman,times,serif&quot;&gt;  &lt;code class=&quot;prettyprint&quot;&gt;&lt;font&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; performSelectorInBackground&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;@selector&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;/span&gt;&lt;/font&gt;&lt;/code&gt;MethodRunOnThread2&lt;code class=&quot;prettyprint&quot;&gt;&lt;font&gt;&lt;span class=&quot;pln&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; withObject&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;nil];&lt;/span&gt;&lt;/font&gt;&lt;/code&gt;&lt;/font&gt;&lt;br /&gt;  pthread_mutex_lock(&amp;amp;mutex);&lt;br /&gt;  phtread_mutex_unlock(&amp;amp;mutex);&lt;br /&gt;  do_next_things...;&lt;br /&gt;}&lt;/font&gt;&lt;/i&gt;&lt;/pre&gt;&lt;i&gt;&lt;font face=&quot;times new roman,times,serif&quot;&gt;MethodRunOnThread2 {&lt;br /&gt;   do something;&lt;br /&gt;   phread_mutex_unlock(&amp;amp;mutex);&lt;br /&gt;}&lt;/font&gt;&lt;/i&gt;&lt;/blockquote&gt;&lt;pre&gt;  &lt;/pre&gt;&lt;pre&gt;&lt;p align=&quot;justify&quot; /&gt;&lt;p align=&quot;justify&quot; /&gt;&lt;p /&gt;&lt;p align=&quot;justify&quot; /&gt;&lt;p align=&quot;justify&quot;&gt;&lt;br /&gt;
&lt;/p&gt;&lt;/pre&gt; 
    </content:encoded>

    <pubDate>Fri, 13 Jan 2012 01:01:57 +0900</pubDate>
    <guid isPermaLink="false">http://www.nikep.net/srdpty/index.php?/archives/86-guid.html</guid>
    
</item>
<item>
    <title>YouTube仕様変更2011/8/4に対応</title>
    <link>http://www.nikep.net/srdpty/index.php?/archives/85-YouTube201184.html</link>
            <category>開発</category>
    
    <comments>http://www.nikep.net/srdpty/index.php?/archives/85-YouTube201184.html#comments</comments>
    <wfw:comment>http://www.nikep.net/srdpty/wfwcomment.php?cid=85</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.nikep.net/srdpty/rss.php?version=2.0&amp;type=comments&amp;cid=85</wfw:commentRss>
    

    <author>nospam@example.com (金子 恵季)</author>
    <content:encoded>
    &lt;br /&gt;
&lt;h1&gt;YouTubeダウンローダを最新仕様に更新&lt;/h1&gt;&lt;p align=&quot;justify&quot;&gt;&lt;a title=&quot;YouTubeダウンローダー&amp;変換サービス&quot; href=&quot;/ytdownloader.var&quot;&gt;YouTubeダウンロードサービス&lt;/a&gt;と&lt;a title=&quot;YouTube Downloader Script&quot; href=&quot;/software.var#_youtube&quot;&gt;ダウンロードスクリプト&lt;/a&gt;がエラーしていたのを修正しました。&lt;/p&gt;&lt;div align=&quot;justify&quot;&gt;&lt;p&gt;Apacheのログを見る限りでは、8/4にYouTubeの仕様が変更されており、ダウンロードが一切できなくなっていました。別の仕事の納期が迫っていたために放置していたのですが、今週頭になんとか上がり、2〜3日前から見ていました。昨日、ようやく最新仕様に合わせて動かすことができるようになりました。&lt;/p&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;変更点は、以下のようなものでした。&lt;/div&gt;&lt;ol&gt;&lt;li&gt;fmt_url_mapがなくなって、url_encoded_fmt_stream_mapになった。&lt;/li&gt;&lt;li&gt;この記述があるタグも変わり、&amp;lt;embed type=&amp;quot;application/x-shockwave-flash&amp;quot;とyt.setConfig({ &#039;PLAYER_CONFIG&#039;:の二箇所になった。後者は初顔。&lt;/li&gt;&lt;li&gt;&lt;div align=&quot;justify&quot;&gt;webmコーデックのファイル(43,44,45)が新登場。&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div align=&quot;justify&quot;&gt;&lt;p&gt;url_encoded_fmt_stream_mapは以前と書式が異なります。今回は、itagでフォーマットタイプを知り、url=http://....でURLを得ます。楽勝と思い実装してみたのですが、なぜか上手く行きません。やみくもにやっていては駄目と思われましたので、少し分析してみました。&lt;/p&gt;&lt;p&gt;はまってしまっていた罠は、以下の2点のようでした。&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&amp;lt;embed ...のほうは、urlエンコードが2回掛かっています。また、PLAYER_CONFIGのほうは、urlエンコードが1回と、Unicode Escape(一部文字に)が1回掛かっています。&lt;/li&gt;&lt;li&gt;webmフォーマットのファイルはurlパラメタそのままで取得できますが、他のフォーマット(mp4/flv)は、quality=以下を切ってやらないと&amp;quot;403 Forbidden&amp;quot;になってしまいます。&lt;/li&gt;&lt;/ol&gt;&lt;p align=&quot;justify&quot;&gt;(1)はプレイヤへの引数渡しの際の禁止文字の都合なのだろうと推測できますが、元々のパラメタが呪文文字列(数字)なので、結構悩みました。(2)に関しては全く見当が付きません。処置が的確なのかどうかすら分らない状態です。&lt;/p&gt;&lt;h2&gt;結論&lt;/h2&gt;&lt;p align=&quot;justify&quot;&gt;このコードで動いています。(embed, PLAYER_CONFIGのどちらでも動きます)&lt;/p&gt;&lt;pre&gt;&lt;i&gt;&lt;font face=&quot;times new roman,times,serif&quot;&gt;	if (m|\&#039;PLAYER_CONFIG\&#039;: {(.*)}$|) {&lt;br /&gt;	    my $rt = GetFmtUrlMapFromPlayerConfig($1);&lt;br /&gt;	    %vphash = %$rt;&lt;br /&gt;	    if (length($title) &amp;lt;= 0) {&lt;br /&gt;		$title = GetTitleFromPlayerConfig($1);&lt;br /&gt;	    }&lt;br /&gt;	} elsif (m|&amp;lt;embed type=\&amp;quot;application/x-shockwave-flash\&amp;quot; +([^&amp;gt;]*)&amp;gt;|) {&lt;br /&gt;	    my $rt = GetFmtUrlMapFromEmbed($1);&lt;br /&gt;	    %vphash = %$rt;&lt;br /&gt;	    if (length($title) &amp;lt;= 0) {&lt;br /&gt;		$title = GetTitleFromEmbed($1);&lt;br /&gt;	    }&lt;br /&gt;	}&lt;/font&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;font face=&quot;times new roman,times,serif&quot;&gt;sub GetFmtUrlMapFromEmbed&lt;br /&gt;{&lt;br /&gt;    my ($argstr) = @_;&lt;br /&gt;    if ($argstr =~ m|;fmt_url_map=([^;\&amp;quot;]+)[;\&amp;quot;]|) {&lt;br /&gt;	my $ar = urldecode($1);&lt;br /&gt;	my @vpbacks = split(/,/, $ar);&lt;br /&gt;	foreach my $vpback (@vpbacks) {&lt;br /&gt;	    $vpback =~ m/^[\s]*([0-9]*)|(.*)[\s]*$/;&lt;br /&gt;	    $vphsh{$1} = $2;&lt;br /&gt;	}&lt;br /&gt;    } elsif ($argstr =~ m|url_encoded_fmt_stream_map=([^\;]+)\;|) {&lt;br /&gt;	my $ar = urldecode($1);&lt;br /&gt;	my @prms = split(/,/, $ar);&lt;br /&gt;	foreach my $prm (@prms) {&lt;br /&gt;	    if ($prm =~ m!itag=([0-9]+)[^0-9]*!) {&lt;br /&gt;		my $fmt = $1;&lt;br /&gt;		my $ar = urldecode($prm);&lt;br /&gt;		if ($ar =~ m!url=([^\;]+)!) {&lt;br /&gt;		    $ar = $1;&lt;br /&gt;		    if ($fmt &amp;lt; 40) {&lt;br /&gt;			#-- not webm&lt;br /&gt;			$ar =~ s!&amp;amp;quality=.*!!;&lt;br /&gt;		    }&lt;br /&gt;		    $vphsh{$fmt} = $ar;&lt;br /&gt;		}&lt;br /&gt;	    }&lt;br /&gt;	}&lt;br /&gt;    }&lt;br /&gt;    return %vphsh;&lt;br /&gt;}&lt;/font&gt;&lt;/i&gt;&lt;/pre&gt;&lt;pre&gt;&lt;i&gt;&lt;font face=&quot;times new roman,times,serif&quot;&gt;sub GetFmtUrlMapFromPlayerConfig&lt;br /&gt;{&lt;br /&gt;    my ($argstr) = @_;&lt;br /&gt;    if ($argstr =~ m|\&amp;quot;url_encoded_fmt_stream_map\&amp;quot;: \&amp;quot;([^\&amp;quot;]+)\&amp;quot;|) {&lt;br /&gt;	my @prms = split(/,/, $1);&lt;br /&gt;	foreach my $prm (@prms) {&lt;br /&gt;	    if ($prm =~ m!itag=([0-9]+)[^0-9]*!) {&lt;br /&gt;		my $fmt = $1;&lt;br /&gt;		my $ar = UnicodeUnescape(urldecode($prm));&lt;br /&gt;		if ($ar =~ m!url=([^\;]+)!) {&lt;br /&gt;		    $ar = $1;&lt;br /&gt;		    if ($fmt &amp;lt; 40) {&lt;br /&gt;			#-- not webm&lt;br /&gt;			$ar =~ s!&amp;amp;quality=.*!!;&lt;br /&gt;		    }&lt;br /&gt;		    $vphsh{$fmt} = $ar;&lt;br /&gt;		}&lt;br /&gt;	    }&lt;br /&gt;	}&lt;br /&gt;    }&lt;br /&gt;    return %vphsh;&lt;br /&gt;}&lt;/font&gt;&lt;/i&gt;&lt;/pre&gt;&lt;p&gt;れで動くようになりましたが、webm対応ができていません。今後、主力のコーデックになるようなので、将来的には対応は必須なのでしょう。しかし、現在はバックワードコンパチビリティのためのmp4はおろか、flvまで用意されているようですので、後回しにします。というのも、コーデックが新しいので、サーバで使っているシステムに導入するのは骨なのです。それに、性能の上では圧倒的に優れている、という訳でもなさそうなことも一因です。&lt;/p&gt;&lt;p align=&quot;justify&quot;&gt;しかし、政治的な観点では、ライセンスフリーのwebmは大歓迎ですので、なんとかしたいものです。GIFやMP3で繰り返された混乱は、サービスを提供する側からすると大きな障害になってしまいますので。&lt;/p&gt;&lt;p /&gt;&lt;p /&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;/div&gt; 
    </content:encoded>

    <pubDate>Fri, 19 Aug 2011 04:05:08 +0900</pubDate>
    <guid isPermaLink="false">http://www.nikep.net/srdpty/index.php?/archives/85-guid.html</guid>
    
</item>
<item>
    <title>YouTubeダウンローダーでタイトルが取れないのを修正</title>
    <link>http://www.nikep.net/srdpty/index.php?/archives/83-YouTube.html</link>
            <category>開発</category>
    
    <comments>http://www.nikep.net/srdpty/index.php?/archives/83-YouTube.html#comments</comments>
    <wfw:comment>http://www.nikep.net/srdpty/wfwcomment.php?cid=83</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.nikep.net/srdpty/rss.php?version=2.0&amp;type=comments&amp;cid=83</wfw:commentRss>
    

    <author>nospam@example.com (金子 恵季)</author>
    <content:encoded>
    &lt;h1 align=&quot;justify&quot;&gt;YouTubeビデオのタイトルの仕様変更対応&lt;/h1&gt;&lt;p align=&quot;justify&quot;&gt;YouTube ダウンローダスクリプトでタイトルが取れなくなっているのに気が付きました。このため、&amp;quot;タイトル名.mp4&amp;quot;というファイル名になりません。どうやら、YouTubeに変更があったようです。しばらく放置していたのですが、修正することにしました。&lt;/p&gt;&lt;p&gt;手元で問題のページをwgetで取得してみると、今迄取得に使っていた&amp;lt;meta title=&amp;quot;&amp;quot;&amp;gt;のタグはあるようなのですが、スクリプトにすると取得てきていないようです。少し謎です。YouTubeはクライアントの違いによって色々なHTMLを返してくるようになっていますので、素直にデバッグは諦めて、他の部分に記載されたタイトルから拾うことにしました。&lt;/p&gt;&lt;p&gt;それで、修正したものがこちらです。&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://www.nikep.net/software.php#_youtube&quot;&gt;YouTubeダウンロードスクリプト&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.nikep.net/ytdownloader.var&quot;&gt;YouTubeダウンロードサービス&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;何か不具合があれば、お知らせ下さいませ。&lt;/p&gt;&lt;p&gt;なお、スクリプトのほうは、&lt;a href=&quot;http://www.nikep.net/srdpty/index.php?/archives/27-YouTube.html#comments&quot;&gt;バグ報告いただいていた件&lt;/a&gt;(wgetで動作しない)も修正してあります。&lt;/p&gt;&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Fri, 06 May 2011 01:28:15 +0900</pubDate>
    <guid isPermaLink="false">http://www.nikep.net/srdpty/index.php?/archives/83-guid.html</guid>
    
</item>
<item>
    <title>Decreasing number of the wallpaper distributing system</title>
    <link>http://www.nikep.net/srdpty/index.php?/archives/82-Decreasing-number-of-the-wallpaper-distributing-system.html</link>
            <category>開発</category>
    
    <comments>http://www.nikep.net/srdpty/index.php?/archives/82-Decreasing-number-of-the-wallpaper-distributing-system.html#comments</comments>
    <wfw:comment>http://www.nikep.net/srdpty/wfwcomment.php?cid=82</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.nikep.net/srdpty/rss.php?version=2.0&amp;type=comments&amp;cid=82</wfw:commentRss>
    

    <author>nospam@example.com (金子 恵季)</author>
    <content:encoded>
    &lt;br /&gt;
&lt;h1&gt;Wallpapers for photostand application.&lt;/h1&gt;&lt;p&gt;I provide &lt;a href=&quot;http://www.nikep.net/wallpaperservice.var&quot;&gt;the wallpaper distributing system&lt;/a&gt; for &lt;a href=&quot;http://www.nikep.net/wphotostand.var&quot;&gt;Linux &lt;/a&gt;and &lt;a href=&quot;http://www.nikep.net/photostand.var&quot;&gt;Windows&lt;/a&gt;. And I&#039;m sorry to have a trouble to display a uncool picture on users screen.&lt;b&gt;&lt;/b&gt;&lt;br /&gt;  &lt;/p&gt;&lt;p&gt;Two days ago I found some wallpapers are replaced to &amp;quot;Oops&amp;quot; image instead of original ones. To my understanding, it is made by a site to avoid their pictures from downloading without showing their advertisement banners. The site is included in my directory, from which a recommended pictures are selected by matching user keywords. &lt;/p&gt;&lt;p&gt;Basically I don&#039;t have any pictures becase of copy right reason, and the service has a directory of pictures with thumbnails, so that it acts as a kind of search engine of images. (Only exclusion is nasaimage, and we provide under its rule of copyright). And I think that it is fair for each sites to decide how to distribute their contents, so I should respect their desision and give up checking the site technically.&lt;/p&gt;&lt;p&gt;Then I remove the site URL from the directory and rebuild a database of picture pool. And I feel disappointed to find that the number of pictures in the pool is decreased to be a half of the day before. &lt;br /&gt; &lt;/p&gt;&lt;p&gt;I think to be a risk that my service depends much on a few other&#039;s site. So I add three small wallpaper sites in the directory Yesterday. It does not increase the number dramatically, but I&#039;d like to add many other site to be the number of pictures up to 10 thousand again.&lt;/p&gt;&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Mon, 02 May 2011 06:33:44 +0900</pubDate>
    <guid isPermaLink="false">http://www.nikep.net/srdpty/index.php?/archives/82-guid.html</guid>
    
</item>
<item>
    <title>Utility Scripts for FireGestures II</title>
    <link>http://www.nikep.net/srdpty/index.php?/archives/81-Utility-Scripts-for-FireGestures-II.html</link>
            <category>開発</category>
    
    <comments>http://www.nikep.net/srdpty/index.php?/archives/81-Utility-Scripts-for-FireGestures-II.html#comments</comments>
    <wfw:comment>http://www.nikep.net/srdpty/wfwcomment.php?cid=81</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.nikep.net/srdpty/rss.php?version=2.0&amp;type=comments&amp;cid=81</wfw:commentRss>
    

    <author>nospam@example.com (金子 恵季)</author>
    <content:encoded>
    &lt;br /&gt;
&lt;h1&gt;Script To Copy Link URL to clipboard.&lt;/h1&gt;&lt;p&gt;I create an another javascript for FireGestures. The function is to copy URL of the link to system clipboard/cut buffer. Basically it should work on any systems such as Linux, Windows or Mac OS X.&lt;/p&gt;&lt;p&gt;I like to use FireGestures on firefox browser, and &lt;a href=&quot;http://www.nikep.net/srdpty/index.php?/archives/78-Scripts-for-FireGesture-on-Firefox.html&quot;&gt;made some user scripts&lt;/a&gt; to extend the funtion. This script is useful when you download media files by using download scripts instead of viewing on the browser. I made it to use when I want to get sequencial images or video files with &lt;a href=&quot;http://www.nikep.net/software.var#_incwget&quot;&gt;incwget&lt;/a&gt;, and download videos from YouTube with &lt;a href=&quot;http://www.nikep.net/software.var#_youtube&quot;&gt;ytdownloader.pl&lt;/a&gt;. Mozilla supports the function with right button menu, but I often feel irritated to copy many URLs.&lt;/p&gt;&lt;p&gt;The code is here;&lt;/p&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;i&gt;&lt;font face=&quot;times new roman,times,serif&quot;&gt;var linkURL = FireGestures.getLinkURL();&lt;br /&gt;if (!linkURL)&lt;br /&gt;  throw FireGestures.getLocaleString(&amp;quot;ERROR_NOT_ON_LINK&amp;quot;);&lt;br /&gt;var clipboard = Cc[&amp;quot;@mozilla.org/widget/clipboardhelper;1&amp;quot;].getService(Ci.nsIClipboardHelp&lt;br /&gt;er);&lt;br /&gt;clipboard.copyString(linkURL);&lt;/font&gt;&lt;/i&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;p /&gt;&lt;p&gt;&lt;br /&gt;
&lt;/p&gt; 
    </content:encoded>

    <pubDate>Tue, 26 Apr 2011 03:49:38 +0900</pubDate>
    <guid isPermaLink="false">http://www.nikep.net/srdpty/index.php?/archives/81-guid.html</guid>
    
</item>
<item>
    <title>iPadアプリケーション</title>
    <link>http://www.nikep.net/srdpty/index.php?/archives/79-iPad.html</link>
            <category>開発</category>
    
    <comments>http://www.nikep.net/srdpty/index.php?/archives/79-iPad.html#comments</comments>
    <wfw:comment>http://www.nikep.net/srdpty/wfwcomment.php?cid=79</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.nikep.net/srdpty/rss.php?version=2.0&amp;type=comments&amp;cid=79</wfw:commentRss>
    

    <author>nospam@example.com (金子 恵季)</author>
    <content:encoded>
    &lt;br /&gt;
&lt;h1&gt;iPadアプリ「幸福の王子」公開&lt;/h1&gt;&lt;p align=&quot;justify&quot;&gt;&lt;a href=&quot;http://eitokusya.com/main/&quot; title=&quot;eitokusya&quot;&gt;合同会社英徳社&lt;/a&gt;からiPadアプリ「幸福の王子」がAppStoreに出ました。私がソフトウェア部分の開発を請け負っていたものです。&lt;/p&gt;&lt;p align=&quot;justify&quot;&gt;&lt;a href=&quot;http://www.nikep.net/srdpty/uploads/talkbook-info.jpg&quot; class=&quot;serendipity_image_link&quot;&gt;&lt;!-- s9ymdb:70 --&gt;&lt;img width=&quot;110&quot; height=&quot;85&quot; src=&quot;http://www.nikep.net/srdpty/uploads/talkbook-info.serendipityThumb.jpg&quot; style=&quot;border: 0px none ; float: right; padding-left: 5px; padding-right: 5px;&quot; class=&quot;serendipity_image_right&quot; /&gt;&lt;/a&gt;絵本アプリで、テキストと挿絵を見ながら、日本語、英語のバイリンガルで朗読してくれます。お話はオスカー・ワイルドの原作で、王子様の黄金像と心優しい燕の悲しい、良く知られた物語です。朗読は、役者さんに入れていただいた、とのことで、大変聞き易いものになっています。物語全部ですので、日本語のほうだけで30分くらいあり、長い通勤などでも充分楽しめるボリュームがあります。&lt;/p&gt;&lt;p align=&quot;justify&quot;&gt;ソフト的には、英語学習者、日本語学習者に使っていただくことも想定して、お話途中で音声とテキスト画面をワンボタンで切り替えが可能にしています。また、どこを読んでいるか、カーソルで追えるようになっており、再生箇所をタッチで指定することもできます。&lt;/p&gt;&lt;p align=&quot;justify&quot;&gt;画面的に定型のiPad/iPhoneアプリではなかったりすることも含めて、お客様からどういった声をいただけるのか、とても楽しみです。&lt;/p&gt;&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Fri, 25 Mar 2011 03:41:24 +0900</pubDate>
    <guid isPermaLink="false">http://www.nikep.net/srdpty/index.php?/archives/79-guid.html</guid>
    
</item>
<item>
    <title>Scripts for FireGesture on Firefox</title>
    <link>http://www.nikep.net/srdpty/index.php?/archives/78-Scripts-for-FireGesture-on-Firefox.html</link>
            <category>開発</category>
    
    <comments>http://www.nikep.net/srdpty/index.php?/archives/78-Scripts-for-FireGesture-on-Firefox.html#comments</comments>
    <wfw:comment>http://www.nikep.net/srdpty/wfwcomment.php?cid=78</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.nikep.net/srdpty/rss.php?version=2.0&amp;type=comments&amp;cid=78</wfw:commentRss>
    

    <author>nospam@example.com (金子 恵季)</author>
    <content:encoded>
    &lt;br /&gt;
&lt;h1&gt;Utility Scripts for FireGestures&lt;/h1&gt;&lt;p&gt;I wrote some scripts of internet search of words in clipboard for FireGestures.&lt;/p&gt;&lt;p&gt;FireGesture is a very useful addon to enable flexible mouse gestures on Firefox. It has a extension scheme with that user defined gestures and functions can be added. User functions should be written by Javascipt. A little before I downloaded a script named &amp;quot;open URL in clipboard&amp;quot;, and I wrote some scripts from it.&lt;/p&gt;&lt;p /&gt;&lt;ol&gt;&lt;li&gt;Web Search&lt;/li&gt;&lt;li&gt;Wikipedia search&lt;/li&gt;&lt;li&gt;Image Search&lt;/li&gt;&lt;li&gt;Map Search&lt;/li&gt;&lt;li&gt;Video Search&lt;/li&gt;&lt;li&gt;Dictionary Search&lt;/li&gt;&lt;/ol&gt;&lt;h2&gt;Base script&lt;/h2&gt;&lt;p /&gt;&lt;p&gt;Base scripts of those are identical as follows. The default behavier is open new tab to show the page. (It can be changed with some flags in the script.)&lt;/p&gt;&lt;blockquote&gt;&lt;font size=&quot;2&quot; face=&quot;&#039;times new roman&#039;, times, serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;i&gt;const IN_NEW_TAB = true;&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;&lt;font size=&quot;2&quot; face=&quot;&#039;times new roman&#039;, times, serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;i&gt;const IN_BACKGROUND = true;&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;&lt;font size=&quot;2&quot; face=&quot;&#039;times new roman&#039;, times, serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;i&gt;var str = readFromClipboard();&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;&lt;font size=&quot;2&quot; face=&quot;&#039;times new roman&#039;, times, serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;i&gt;if (!str)&lt;/i&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;&#039;times new roman&#039;, times, serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;i&gt; return;&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;&lt;font size=&quot;2&quot; face=&quot;&#039;times new roman&#039;, times, serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;i&gt;  str = encodeURIComponent(str);&lt;/i&gt;&lt;/font&gt;&lt;br /&gt;&lt;font size=&quot;2&quot; face=&quot;&#039;times new roman&#039;, times, serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;i&gt;&lt;font color=&quot;#ff3300&quot; class=&quot;Apple-style-span&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;str = &lt;/font&gt;&amp;quot;http://www.google.co.jp/search?hl=ja&amp;amp;source=hp&amp;amp;q=&amp;quot; + str + &amp;quot;&amp;amp;aq=f&amp;amp;aqi=g10&amp;amp;aql=&amp;amp;oq=&amp;amp;gs_rfai=&amp;quot;;&lt;/font&gt;&lt;br /&gt;if (IN_NEW_TAB)&lt;br /&gt;
&lt;br /&gt;  gBrowser.loadOneTab(str, null, null, null, IN_BACKGROUND, false);&lt;br /&gt;else&lt;br /&gt;  gBrowser.loadURI(str);&lt;/i&gt;&lt;/font&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;font size=&quot;3&quot; face=&quot;arial,helvetica,sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;And then replace the red line to other URL of search engine sites for each media. The followings are my setting living in Japan, so that URLs are Japanse sites. Please change them to fit your country environment.&lt;/font&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Web Search: Gesture: letter &amp;quot;G&amp;quot; (ULDRUL), URL (&lt;font size=&quot;2&quot;&gt;&lt;i&gt;&amp;quot;http://www.google.co.jp/search?hl=ja&amp;amp;source=hp&amp;amp;q=&amp;quot; + str + &amp;quot;&amp;amp;aq=f&amp;amp;aqi=g10&amp;amp;aql=&amp;amp;oq=&amp;amp;gs_rfai=&amp;quot;&lt;/i&gt;&lt;/font&gt;)&lt;/li&gt;&lt;li&gt;Wikipedia search: Gesture: letter &amp;quot;W&amp;quot; (DUDU), URL(&lt;i&gt;&lt;font size=&quot;2&quot;&gt;&amp;quot;http://ja.wikipedia.org/w/index.php?search=&amp;quot; + str&lt;/font&gt;&lt;/i&gt;)&lt;/li&gt;&lt;li&gt;Image Search: letter &amp;quot;GI&amp;quot; (ILDRULD), URL(&lt;font size=&quot;2&quot;&gt;&lt;i&gt;&amp;quot;http://images.google.co.jp/images?hl=ja&amp;amp;source=imghp&amp;amp;q=&amp;quot; + str + &amp;quot;&amp;amp;gbv=2&amp;amp;aq=f&amp;amp;aqi=g4&amp;amp;aql=&amp;amp;oq=&amp;amp;gs_rfai=&amp;quot;&lt;/i&gt;&lt;/font&gt;)&lt;/li&gt;&lt;li&gt;Map Search: letter &amp;quot;M&amp;quot; (UDUD), URL(&lt;font size=&quot;2&quot;&gt;&lt;i&gt;&amp;quot;http://maps.google.co.jp/maps?f=q&amp;amp;source=s_q&amp;amp;hl=ja&amp;amp;geocode=&amp;amp;q=&amp;quot; + str + &amp;quot;&amp;amp;ie=UTF8&amp;quot;&lt;/i&gt;&lt;/font&gt;)&lt;/li&gt;&lt;li&gt;Video Search: letter &amp;quot;Y&amp;quot;(DRUDLUR), URL&lt;i&gt;(&lt;font size=&quot;2&quot;&gt;&amp;quot;http://www.youtube.com/results?search_query=&amp;quot; + str&lt;/font&gt;&lt;/i&gt;)&lt;/li&gt;&lt;li&gt;Dictionary: letter &amp;quot;D&amp;quot;(DRUL), URL(&lt;font size=&quot;2&quot;&gt;&lt;i&gt;&amp;quot;http://www.weblio.jp/content/&amp;quot; + str&lt;/i&gt;&lt;/font&gt;)&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;font size=&quot;3&quot; face=&quot;arial,helvetica,sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size=&quot;3&quot; face=&quot;arial,helvetica,sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size=&quot;3&quot; face=&quot;arial,helvetica,sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size=&quot;2&quot; face=&quot;verdana, arial, helvetica, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size=&quot;2&quot; face=&quot;verdana, arial, helvetica, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;/font&gt;&lt;/p&gt;&lt;pre&gt;&lt;font size=&quot;2&quot; face=&quot;&#039;times new roman&#039;, times, serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;i&gt;&lt;/i&gt;&lt;/font&gt;&lt;/pre&gt;&lt;pre&gt;&lt;font size=&quot;2&quot; face=&quot;&#039;times new roman&#039;, times, serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;i&gt;&lt;/i&gt;&lt;/font&gt;&lt;/pre&gt;&lt;p /&gt;&lt;p /&gt;&lt;p /&gt;&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/p&gt; 
    </content:encoded>

    <pubDate>Wed, 09 Mar 2011 05:39:46 +0900</pubDate>
    <guid isPermaLink="false">http://www.nikep.net/srdpty/index.php?/archives/78-guid.html</guid>
    
</item>
<item>
    <title>YouTubeダウンローダーの更新</title>
    <link>http://www.nikep.net/srdpty/index.php?/archives/77-YouTube.html</link>
            <category>開発</category>
    
    <comments>http://www.nikep.net/srdpty/index.php?/archives/77-YouTube.html#comments</comments>
    <wfw:comment>http://www.nikep.net/srdpty/wfwcomment.php?cid=77</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.nikep.net/srdpty/rss.php?version=2.0&amp;type=comments&amp;cid=77</wfw:commentRss>
    

    <author>nospam@example.com (金子 恵季)</author>
    <content:encoded>
    &lt;br /&gt;
&lt;h1 align=&quot;justify&quot;&gt;YouTubeの最新仕様に対応&lt;/h1&gt;&lt;p&gt;昨日、&lt;a href=&quot;http://www.nikep.net/ytdownloader.var&quot; title=&quot;ytdownloader&quot;&gt;YouTubeダウンローダー&amp;amp;変換サービス&lt;/a&gt;でYouTubeのファイルを変換して見ようとして、うまく行かないのがあるのに気付きました。普段あまり見ない映画系のビデオでした。分野に依るのかもしれませんが、ビデオのURLがうまく取れてないらしいのです。&lt;/p&gt;&lt;p&gt;ファイルを調べてみたところ、確かに今迄に実装したビデオURL形式が一つもなく、以下の3種類の組み合わせだけになっているものでした。&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&amp;lt;embed type=\&amp;quot;application/x-shockwave-flash\&amp;quot; で始まるもの&lt;/li&gt;&lt;li&gt;var swfConfig =  で始まるもの&lt;/li&gt;&lt;li&gt;PLAYER_CONFIG で始まるもの&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;これらの内容自体は皆同じビデオURLを指定しているようです。そこで、この3つに対応するため、&lt;a href=&quot;http://www.nikep.net/srdpty/index.php?/archives/51-YouTube.html&quot;&gt;これ&lt;/a&gt;以来久し振りにコードを変更し、とりあえず動くようにはできました。ただ、あいかわらず、複数の形式が1つのページに入っているのですが、規則性も、どれを優先すれば良いのかも分かりません。&lt;/p&gt;&lt;p&gt;これで、都合7種類(&amp;quot;fullscreenurl&amp;quot;は既に使われていないかも)の指定形式があることになります。登場してすぐになくなった呪文パラメタを要するものを加えると9種類です。&lt;/p&gt;&lt;p align=&quot;justify&quot;&gt;YouTubeに関して残っているものとしては、ログインしないと見られないアダルト系のビデオがあります。やるとすると、ダミーユーザを作ってログインをシミュレートした後にCookieを送れば良いのだと思います。しかしながら、あまり需要がなさそうです。YouTubeは基本的に健全なサイトですから。&lt;/p&gt;&lt;p /&gt;&lt;p /&gt;&lt;br /&gt;
&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Sat, 05 Mar 2011 03:37:44 +0900</pubDate>
    <guid isPermaLink="false">http://www.nikep.net/srdpty/index.php?/archives/77-guid.html</guid>
    
</item>
<item>
    <title>Slashdot用GreaseMonkeyスクリプト</title>
    <link>http://www.nikep.net/srdpty/index.php?/archives/75-SlashdotGreaseMonkey.html</link>
            <category>開発</category>
    
    <comments>http://www.nikep.net/srdpty/index.php?/archives/75-SlashdotGreaseMonkey.html#comments</comments>
    <wfw:comment>http://www.nikep.net/srdpty/wfwcomment.php?cid=75</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.nikep.net/srdpty/rss.php?version=2.0&amp;type=comments&amp;cid=75</wfw:commentRss>
    

    <author>nospam@example.com (金子 恵季)</author>
    <content:encoded>
    &lt;br /&gt;
&lt;h1&gt;スラドの公告ページを回避するスクリプト&lt;/h1&gt;&lt;p align=&quot;justify&quot;&gt;スラッシュドットに貼られた外部リンクをクリックすると、公告付きベージが表示され、そこから改めてクリックして外に出るようになっています。運営のために仕方ないのかもしれませんが、何ともウザイ仕様です。これを回避するGreaseMonkey user scriptです。&lt;/p&gt;&lt;p align=&quot;justify&quot;&gt;&lt;a href=&quot;/slashdots/slashdots.user.js&quot; title=&quot;slashdots.user.js&quot;&gt;これ→(slashdots.user.js)&lt;/a&gt;です。&lt;/p&gt;&lt;h2&gt;使い方&lt;/h2&gt;&lt;p align=&quot;justify&quot;&gt;何もありません。インストールすれば即、効きます。&lt;/p&gt;&lt;h2&gt;アンインストール&lt;/h2&gt;&lt;p align=&quot;justify&quot;&gt;GreaseMonkeyの管理画面から「アンインストール」します。&lt;/p&gt;&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Mon, 14 Feb 2011 02:35:44 +0900</pubDate>
    <guid isPermaLink="false">http://www.nikep.net/srdpty/index.php?/archives/75-guid.html</guid>
    
</item>
<item>
    <title>ヤフオク用Greasemonkeyスクリプト VIII</title>
    <link>http://www.nikep.net/srdpty/index.php?/archives/66-Greasemonkey-VIII.html</link>
            <category>開発</category>
    
    <comments>http://www.nikep.net/srdpty/index.php?/archives/66-Greasemonkey-VIII.html#comments</comments>
    <wfw:comment>http://www.nikep.net/srdpty/wfwcomment.php?cid=66</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.nikep.net/srdpty/rss.php?version=2.0&amp;type=comments&amp;cid=66</wfw:commentRss>
    

    <author>nospam@example.com (金子 恵季)</author>
    <content:encoded>
    &lt;br /&gt;
&lt;h1&gt;YahooAuctionSの最近のヤフオク仕様変更に合わせた改版&lt;/h1&gt;&lt;p&gt;&lt;a href=&quot;http://www.nikep.net/srdpty/index.php?/archives/64-Greasemonkey-VII.html&quot; title=&quot;YahooAuctionS GreaseMonkey&quot;&gt;こちら&lt;/a&gt;の続きです。最近ヤフオクは公告収入の増収を狙って(？)、画面の大幅な変更と公告スペースの拡大を行いました。これに合わせてユーザスクリプトも変更しました。特に大幅に増えた公告対応をしました。&lt;a href=&quot;http://www.nikep.net/srdpty/index.php?/archives/39-Greasemonkey-III.html&quot;&gt;こちら&lt;/a&gt;を見て、設定をカスタマイズしてご利用下さい。&lt;/p&gt;&lt;p&gt;スクリプトはこれ→&lt;a target=&quot;_blank&quot; title=&quot;yahooauctions.user.js&quot; href=&quot;http://www.nikep.net/srdpty/uploads/20100828/yahooauctions.user.js&quot;&gt;yahooauctions.user.js&lt;/a&gt;です。&lt;/p&gt;&lt;p&gt;&lt;br /&gt;
&lt;/p&gt; 
    </content:encoded>

    <pubDate>Sat, 28 Aug 2010 23:14:36 +0900</pubDate>
    <guid isPermaLink="false">http://www.nikep.net/srdpty/index.php?/archives/66-guid.html</guid>
    
</item>
<item>
    <title>C# .Net Frameworkで2重起動に対応</title>
    <link>http://www.nikep.net/srdpty/index.php?/archives/65-C-.Net-Framework2.html</link>
            <category>開発</category>
    
    <comments>http://www.nikep.net/srdpty/index.php?/archives/65-C-.Net-Framework2.html#comments</comments>
    <wfw:comment>http://www.nikep.net/srdpty/wfwcomment.php?cid=65</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.nikep.net/srdpty/rss.php?version=2.0&amp;type=comments&amp;cid=65</wfw:commentRss>
    

    <author>nospam@example.com (金子 恵季)</author>
    <content:encoded>
    &lt;br /&gt;
&lt;h1&gt;C#で二重起動を禁止するコード、起動済みプロセスに処理を移管するコード&lt;/h1&gt;&lt;p&gt;アプリケーションは通常、プロセスとして複数起動できるものですが、何かの理由で1つのみ起動できるようにしたい場合があります。例えば、唯一リソースにアクセスするものや、インスタンス間の連携のためにスレッドで実現したい場合などです。後者はWindowsでは良く見る仕様で、Officeがそうですし、Adobe Readerなどもそうです。また、Macでは複数のアプリを上げようとしても、既に起動しているインスタンスに切り替わります。&lt;/p&gt;&lt;p&gt;ここでは、単純に2つの仕様の実装を紹介します。&lt;/p&gt;&lt;ol&gt;&lt;li&gt;二重起動を単に阻止する。2つ目を上げようとしたときに警告を出して終了する。&lt;/li&gt;&lt;li&gt;2つ目を上げようとしたとき、既に起動しているプロセスが(あたかも起動したかのように)表示される。&lt;/li&gt;&lt;/ol&gt;&lt;p /&gt;&lt;h2&gt;二重起動を阻止&lt;/h2&gt;&lt;p&gt;プロセスの始めのほうの行に、以下のコードを入れます。Program.cs内で充分です。&lt;/p&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;i&gt;&lt;font size=&quot;3&quot; face=&quot;times new roman,times,serif&quot;&gt;// check not to run same processes simultaneously.&lt;br /&gt;if (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length &amp;gt; 1) {&lt;br /&gt;        MessageBox.Show(Properties.Resources.isAlreadyRunning);&lt;br /&gt;        return;&lt;br /&gt;}&lt;/font&gt;&lt;font size=&quot;3&quot;&gt;&lt;/font&gt;&lt;/i&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;p&gt;要するに、起動プロセスと同じ名前のプロセスがあったら、警告ダイアログを出して終了します。&lt;/p&gt;&lt;h2&gt;起動済みプロセスに処理を任せる&lt;/h2&gt;&lt;p&gt;前述のMacのような仕様です。起動しようとするユーザは、そのタスクを実行したいのですから、「できない」とか言われても困ってしまいます。できる限り、ユーザがやりたいことを実現するべきでしょう。2つ目を上げようとすると、起動できたように見えて、実は1つ目のプロセスのウィンドウがアクティブ状態で表示されます。&lt;/p&gt;&lt;p&gt;なのですが、こちらのほうは実装がすっきりしません。本来であれば、起動済みプロセスにお知らせして、実行を代行してもらうように実装すべき(UNIXであれば、このように実装するでしょう)なのですが、手軽ではありません。そこで、WinAPIを使って、表示を制御してしまいます。&lt;/p&gt;&lt;blockquote&gt;&lt;pre&gt; &lt;i&gt;&lt;font size=&quot;3&quot; face=&quot;times new roman,times,serif&quot;&gt;// check not to run same processes simultaneously.&lt;br /&gt; if (ActivateRunningProcess()) {&lt;br /&gt;         return;&lt;br /&gt; }&lt;br /&gt;----------        &lt;br /&gt;// Activate the process, if a instance is already running.&lt;br /&gt;private static bool ActivateRunningProcess() {&lt;br /&gt;    string pnm = Process.GetCurrentProcess().ProcessName.ToString();&lt;br /&gt;    string cls = &amp;quot;WindowsForms10.Window.8.app.0.33c0d9d&amp;quot;;&lt;br /&gt;    IntPtr hWnd = FindWindow(cls, pnm);&lt;br /&gt;    if (hWnd == IntPtr.Zero) {&lt;br /&gt;        //-- With debugger .vshost must be added after the processname.&lt;br /&gt;        string pnmr = pnm.Replace(&amp;quot;.vshost&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;        if (!pnmr.Equals(pnm)) {&lt;br /&gt;            hWnd = FindWindow(cls, pnmr);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    if (hWnd == IntPtr.Zero) {&lt;br /&gt;        return false;&lt;br /&gt;    }&lt;br /&gt;    bool rts = ShowWindowAsync(hWnd, SW_RESTORE);&lt;br /&gt;    bool rtf = SetForegroundWindow(hWnd);&lt;br /&gt;    if (!rts || !rtf) {&lt;br /&gt;        MessageBox.Show(Properties.Resources.isAlreadyRunning + &amp;quot;(&amp;quot; &lt;br /&gt;                        + (rts?&amp;quot;1&amp;quot;:&amp;quot;0&amp;quot;) + &amp;quot;,&amp;quot; + (rtf?&amp;quot;1&amp;quot;:&amp;quot;0&amp;quot;) + &amp;quot;)&amp;quot;);&lt;br /&gt;    }&lt;br /&gt;    return true;&lt;br /&gt;}&lt;br /&gt;[DllImport(&amp;quot;user32.dll&amp;quot;)]&lt;br /&gt;private static extern bool SetForegroundWindow(IntPtr hWnd);&lt;br /&gt;[DllImport(&amp;quot;user32.dll&amp;quot;)]&lt;br /&gt;private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);&lt;br /&gt;[DllImport(&amp;quot;user32.dll&amp;quot;)]&lt;br /&gt;private static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);&lt;br /&gt;private const int SW_RESTORE = 9;  // Restore the window size&lt;/font&gt;&lt;/i&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;p&gt;起動済みのアプリプロセスを捜すのに、FindWindowを使っています。本当は、GetProcessByNameで捜すべきところなのですが、これでやると、プロセスは見つかりますが、MainWindowHandleが取れない場合があります。デバッグした範囲では、殆どの場合でOKなのですが、ステータス表示のみ(アイコンボックスに表示されているだけ)の常駐状態の場合には無効なWindowHandleが戻ってきます。仕様(実際にMainWindowが作成されていない/破棄されているのかも)なのか、バグなのか分りません。&lt;br /&gt;FindWindowでは、アプリ名のフォルダーを開いているExplorerのプロセス(というかウィンドウ)も掴まえてしまうため、実際上、クラスの指定が必須になります。これは Spy+ で確認できますが、呪文を含む文字列で中身は良く分りません。とりあえず、ビルドし直しても、VisualStudioのバージョンを変えても大丈夫なようです。&lt;br /&gt;また、Visual Studio 2010から、デバッグ時のプロセス名に &amp;quot;.vshost&amp;quot; が付くようになっているようです。この部分のコードは、デバッグ時以外は必要ありません。&lt;/p&gt;&lt;h2&gt;まとめ&lt;/h2&gt;&lt;p&gt;これで、2重起動への対応ができました。上記以外で、通常必要になるかもしれない機能は、起動パラメタを渡すことくらいでしょうか。&lt;/p&gt;&lt;p&gt;WinAPIは既に使うべきではないようですが、便利なので使い続けられて行くでしょう。なんと言うか反則じみていますし、結構危険に思われます。例えば、今回のコードでも、他のプロセスから勝手に表示制御などされてしまえば、最悪プロセスが落ちても文句言えませんよね。稼働中のプロセスの任意のタイミングでスクリーンにマップされてしまう訳で、表示(show)のコールバックなどもアプリが予期せぬタイミングで呼ばれてしまいます。普通に実装していれば動くでしょうが、何らかの状態制御や排他制御などをしていれば必ずしも安全ではありません。&lt;/p&gt;&lt;p /&gt;&lt;p /&gt;&lt;p&gt;&lt;br /&gt;
&lt;/p&gt; 
    </content:encoded>

    <pubDate>Sat, 28 Aug 2010 11:13:03 +0900</pubDate>
    <guid isPermaLink="false">http://www.nikep.net/srdpty/index.php?/archives/65-guid.html</guid>
    
</item>
<item>
    <title>ヤフオク用Greasemonkeyスクリプト VII</title>
    <link>http://www.nikep.net/srdpty/index.php?/archives/64-Greasemonkey-VII.html</link>
            <category>開発</category>
    
    <comments>http://www.nikep.net/srdpty/index.php?/archives/64-Greasemonkey-VII.html#comments</comments>
    <wfw:comment>http://www.nikep.net/srdpty/wfwcomment.php?cid=64</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.nikep.net/srdpty/rss.php?version=2.0&amp;type=comments&amp;cid=64</wfw:commentRss>
    

    <author>nospam@example.com (金子 恵季)</author>
    <content:encoded>
    &lt;br /&gt;
&lt;h1 align=&quot;justify&quot;&gt;YahooAuctionSの改版&lt;/h1&gt;&lt;p&gt;&lt;a href=&quot;http://www.nikep.net/srdpty/index.php?/archives/63-Greasemonkey-VI.html&quot; title=&quot;ヤフオクスクリプト VI&quot;&gt;こちら&lt;/a&gt;の続きです。&lt;/p&gt;&lt;p&gt;先週ヤフオクの検索画面が変更されましたが、昨日更にマイナーチェンジが施されています。検索時のブラックリストが効かなくなりましたので、改修しました。こちら&lt;a target=&quot;_blank&quot; title=&quot;yahooauctions.user.js&quot; href=&quot;http://www.nikep.net/srdpty/uploads/20100723/yahooauctions.user.js&quot;&gt;yahooauctions.user.js&lt;/a&gt;です。&lt;/p&gt;&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Sat, 24 Jul 2010 01:55:59 +0900</pubDate>
    <guid isPermaLink="false">http://www.nikep.net/srdpty/index.php?/archives/64-guid.html</guid>
    
</item>
<item>
    <title>ヤフオク用Greasemonkeyスクリプト VI</title>
    <link>http://www.nikep.net/srdpty/index.php?/archives/63-Greasemonkey-VI.html</link>
            <category>開発</category>
    
    <comments>http://www.nikep.net/srdpty/index.php?/archives/63-Greasemonkey-VI.html#comments</comments>
    <wfw:comment>http://www.nikep.net/srdpty/wfwcomment.php?cid=63</wfw:comment>

    <slash:comments>6</slash:comments>
    <wfw:commentRss>http://www.nikep.net/srdpty/rss.php?version=2.0&amp;type=comments&amp;cid=63</wfw:commentRss>
    

    <author>nospam@example.com (金子 恵季)</author>
    <content:encoded>
    &lt;br /&gt;
&lt;h1&gt;ヤフオク ユーザスクリプト： 新検索画面対応&lt;/h1&gt;&lt;p&gt;&lt;a href=&quot;http://www.nikep.net/srdpty/index.php?/archives/57-Greasemonkey-V.html&quot; title=&quot;ヤフオクスクリプト V&quot;&gt;こちら&lt;/a&gt;のバージョンアップです。&lt;/p&gt;&lt;p&gt;ヤフオクの検索画面がリニューアルされましたので、これに対応しました。&lt;/p&gt;&lt;ul&gt;&lt;li&gt;今迄の機能を新検索画面のフォーマットに合わせました。&lt;/li&gt;&lt;li&gt;各商品のページを閲覧しても未読に戻ってしまう使い難い仕様を旧来のものに戻しました。&lt;/li&gt;&lt;/ul&gt;こちら&lt;a target=&quot;_blank&quot; title=&quot;yahooauctions.user.js&quot; href=&quot;uploads/20100717/yahooauctions.user.js&quot;&gt;yahooauctions.user.js&lt;/a&gt;をクリックするとインストールされます。設定が初期化されてしまいますので、再設定する必要があります。&lt;br /&gt;&lt;a href=&quot;http://www.nikep.net/srdpty/index.php?/archives/39-Greasemonkey-III.html&quot; title=&quot;ヤフオクスクリプトIII&quot;&gt;設定のページ&lt;/a&gt;を参照いただき、元々のスクリプトファイルをyahooauctions.user.jsをバックアップ(例えばデスクトップにコピー)します。次に上記リンクからユーザスクリプトをインストールします。インストールされたユーザスクリプトファイルに、バックアップしたファイルから、設定をコピペ編集します。&lt;p&gt;# そろそろ設定をスクリプトファイルから切離さないと使い難いですね。&lt;br /&gt;&lt;br /&gt;
&lt;/p&gt; 
    </content:encoded>

    <pubDate>Sun, 18 Jul 2010 01:17:25 +0900</pubDate>
    <guid isPermaLink="false">http://www.nikep.net/srdpty/index.php?/archives/63-guid.html</guid>
    
</item>
<item>
    <title>ヤフオク用Greasemonkeyスクリプト V</title>
    <link>http://www.nikep.net/srdpty/index.php?/archives/57-Greasemonkey-V.html</link>
            <category>開発</category>
    
    <comments>http://www.nikep.net/srdpty/index.php?/archives/57-Greasemonkey-V.html#comments</comments>
    <wfw:comment>http://www.nikep.net/srdpty/wfwcomment.php?cid=57</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.nikep.net/srdpty/rss.php?version=2.0&amp;type=comments&amp;cid=57</wfw:commentRss>
    

    <author>nospam@example.com (金子 恵季)</author>
    <content:encoded>
    &lt;br /&gt;
&lt;h1 align=&quot;justify&quot;&gt;YahooAuctionSの機能追加&lt;/h1&gt;&lt;p align=&quot;justify&quot;&gt;&lt;a title=&quot;ヤフオク用Greasemonkeyスクリプト IV&quot; href=&quot;http://www.nikep.net/srdpty/index.php?/archives/56-Greasemonkey-IV.html&quot;&gt;ヤフオク向けGreaseMonkeyユーザスクリプト&lt;/a&gt;の機能を追加しました。こちら&lt;a href=&quot;http://www.nikep.net/srdpty/uploads/20100623/yahooauctions.user.js&quot; title=&quot;yahooauctions.user.js&quot; target=&quot;_blank&quot;&gt;yahooauctions.user.js&lt;/a&gt;です。&lt;/p&gt;&lt;p&gt;変更点は以下の通りです。&lt;/p&gt;&lt;ul&gt;&lt;li&gt;ウォッチリスト画面の表示を「タイトルと画像」に設定するスイッチ(FORCE_TITLE_AND_PICTURE_ON_WATCHLISTをtrueにして下さい)の追加。&lt;/li&gt;&lt;li&gt;上記を設定するとウォッチリストが20個/画面になってしまうのを、50個/画面とする。&lt;/li&gt;&lt;li&gt;ウォッチリストの削除画面から自動で戻る設定をしたときに、&amp;quot;終了したオークション&amp;quot;の削除画面から&amp;quot;開催中のオークション&amp;quot;に戻ってしまう不具合の修正。&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;なお、&amp;quot;設定する&amp;quot;と言っても、ユーザがボタンを押して、表示を明示的に変更した場合は、そちらが優先されます。&lt;/p&gt;&lt;h2&gt;インストール&lt;/h2&gt;&lt;p&gt;Firefoxで、GreaseMonkeyのアドオンがインストールされていれば、単にクリックしていただくだけでインストールされます。詳しい設定方法は、こちら&amp;quot;&lt;a title=&quot;ヤフオク用Greasemonkeyスクリプト III&quot; href=&quot;http://www.nikep.net/srdpty/index.php?/archives/39-Greasemonkey-III.html&quot;&gt;ヤフオク用Greasemonkeyスクリプト II&lt;/a&gt;&amp;quot;をご覧下さい。&lt;/p&gt;&lt;p&gt;&lt;font color=&quot;#339900&quot;&gt;※ &lt;u&gt;FORCE_TITLE_AND_PICTURE_ON_WATCHLIST に不具合があったので、差し替えました&lt;/u&gt;。不具合は、設定しても最初の一回目は反映されないというものです。&lt;/font&gt;&lt;/p&gt;&lt;p /&gt;&lt;p&gt;&lt;br /&gt;
&lt;/p&gt; 
    </content:encoded>

    <pubDate>Wed, 23 Jun 2010 21:35:03 +0900</pubDate>
    <guid isPermaLink="false">http://www.nikep.net/srdpty/index.php?/archives/57-guid.html</guid>
    
</item>

</channel>
</rss>