* テキストブラウザ対応 [#v6f8b1c7] - ページ: [[BugTrack2]] - 投稿者: [[matsuo2]] - 優先順位: 低 - 状態: 提案 - カテゴリー: 本体新機能 - 投稿日: 2006-05-23 (火) 19:59:53 - バージョン: ** メッセージ [#tb1e1b55] 提案です。 テキストブラウザ(w3mとlynx)でkeitaiスキンを使うようにしてみました。 --- pukiwiki.ini.php.org +++ pukiwiki.ini.php @@ -495,6 +499,15 @@ // WebTV array('pattern'=>'#^(WebTV)/([0-9\.]+)#', 'profile'=>'keitai'), + // Text browsers + + // w3m + array('pattern'=>'#^(w3m)/([0-9\.]+)#', 'profile'=>'keitai'), + + // Lynx + array('pattern'=>'#^(Lynx)/([0-9\.]+)#', 'profile'=>'keitai'), + + // Desktop-PC browsers // Opera (for desktop PC, not embedded) -- See BugTrack/743 for detail --- keitai.ini.php.org +++ keitai.ini.php // http://www.au.kddi.com/ezfactory/tec/spec/4_4.html (User-agent strings) if (preg_match('#^KDDI#', $ua_agent)) $max_size = 9; break; + + // Text Browser + case 'lynx': + case 'w3m': + $max_size = 100000; // very large size + break; } pukiwikiのコンテンツを携帯メールへ送るためにテキストブラウザを使用してみようと思い、このような提案になりました。 テキストブラウザを常用している方は、defaultスキンの方が使いやすいのかもしれません。 メールでの送信は次のようにしています。 w3m -cols 22 -O jis http://localhost/pukiwiki/ -dump 2> /dev/null | mail -s pukiwiki matsuo@dummy.keitai.ne.jp -------- - 普通のテキストメールで送るよりも、wget してhtmlメールで送ったほうが便利ではないかと、思いつきました。html形式でメールを送る簡単な方法をご存知な方教えていただけませんか?よろしくお願いします。 -- [[matsuo2]] &new{2006-05-25 (木) 06:43:20}; - こんな雰囲気で実現できました。 -- [[matsuo2]] &new{2006-05-30 (火) 13:10:37}; wget -q http://url/pukiwiki -O- | php -f htmlmail.php your@keitai.email subject htmlmail.php <?php $email=$argv[1]; $title=$argv[2]; while (!feof(STDIN)) { $message .= fgets(STDIN, 1024); } $code = mb_detect_encoding($message, "ASCII,JIS,UTF-8,EUC-JP,SJIS"); $message = mb_convert_encoding($message, 'ISO-2022-JP', $code); $headers .= "From: $email\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-type: text/html; charset=iso-2022-jp\n"; mail($email, $title, $message, $headers); ?> 変更点 --- pukiwiki.ini.php.org +++ pukiwiki.ini.php // WebTV array('pattern'=>'#^(WebTV)/([0-9\.]+)#', 'profile'=>'keitai'), + // Text browsers + + // w3m + array('pattern'=>'#^(w3m)/([0-9\.]+)#', 'profile'=>'keitai'), + + // Lynx + array('pattern'=>'#^(Lynx)/([0-9\.]+)#', 'profile'=>'keitai'), + + // wget + array('pattern'=>'#^(Wget)/([0-9\.]+)#', 'profile'=>'keitai'), + + // Desktop-PC browsers // Opera (for desktop PC, not embedded) -- See BugTrack/743 for detail --- keitai.ini.php.org +++ keitai.ini.php @@ -159,6 +159,13 @@ // http://www.au.kddi.com/ezfactory/tec/spec/4_4.html (User-agent strings) if (preg_match('#^KDDI#', $ua_agent)) $max_size = 9; break; + + // Text Browser + case 'lynx': + case 'w3m': + case 'Wget': + $max_size = 100000; // very large size + break; } - しかし、手持ちの携帯ではHTMLメールが表示できないことが発覚 (T_T) -- [[matsuo2]] &new{2006-05-30 (火) 13:15:59}; - そこで mpack を使って、添付して送ってみました -- [[matsuo2]] &new{2006-05-30 (火) 13:24:34}; wget -q http://url/pukiwiki -O /tmp/pukiwiki.html && mpack -s "subject" /tmp/pukiwiki.html matsuo@dummy.keitai.ne.jp && rm /tmp/pukiwiki.html - しかし、メールに添付されたhtmlを表示するための、ブラウザ起動に少し時間がかかってしまいます。 -- [[matsuo2]] &new{2006-05-30 (火) 13:32:56}; - wgetもテキストブラウザのひとつとして扱うようにしています -- [[matsuo2]] &new{2006-05-30 (火) 13:38:54}; #comment