Category: Accessibility

テキストブラウザ対応

メッセージ

提案です。 テキストブラウザ(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 -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;
 }


トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2010-03-08 (月) 11:53:58
Site admin: PukiWiki Development Team

PukiWiki 1.5.4+ © 2001-2022 PukiWiki Development Team. Powered by PHP 8.2.12. HTML convert time: 0.219 sec.

SourceForge