(2013-03-09 è¿½è¨ - 2021-05-09 転è¨ã»è¿½è¨)
- ã¯ããã«
- w3mã®ã¤ã³ã¹ãã¼ã«
- w3mã®Tips
- w3mã®èµ·åã¨ããã¹ããã¡ã¤ã«ã®æ´»ç¨
- éæ³ã®ãã¼ã:ã
- èµ·åãç°¡åã«
- ã¿ããå©ç¨ãã
- ãã¼ã«ã«CGIã®æ´»ç¨
- shellãrubyçã®ã¹ã¯ãªãããæ´»ç¨ãã
- ãããã«
- é¢é£ãã¼ã¸
Â
(2021-05-09 追è¨)
å½ãµã¤ãã§ã¯ãï¼çªç®ã«äººæ°ã®ãã¼ã¸ã§ãããæ£ç´ãªãä»ã§ã人æ°ãªã®ããææ¡ã§ãã¦ããªãã^^;Â
ã¯ããã«
w3mã¯ãããã¹ããã©ã¦ã¶ã¨ãã¦ã¯ããã¼ãã«ããã¬ã¼ã ã®è¡¨ç¤ºãåªãã¦ãããããªã以åãã使ã£ã¦ãããæ°ã«å
¥ãã®ã½ããã
æè¿ã¯ãã©ã¦ã¶ã¨ãããããããã¼ã¸ã£ããã¡ã¤ã«ãã¥ã¼ã¢ãããã«ã¢ããªã±ã¼ã·ã§ã³ã®ã©ã³ãã£ã¨ãã¦å©ç¨ãããã¨ãå¤ããªã£ã¦ããã
w3mã®é åã¯è±å¯ã§ãã¾ã ã¾ã æ´»ç¨ãããã¦ããªãçè ã ããw3mãå©ç¨ããä¸ã§ã®Tipsã便å©ãªæ´»ç¨æ³ããã®ãã¼ã¸ã«è¨è¼ããã
ã¾ãæåã«ãåèã«ããã¦é ãããµã¤ãã以ä¸ã«ç¤ºãã
w3mã®ã¤ã³ã¹ãã¼ã«
w3mã®ã¤ã³ã¹ãã¼ã«ã¯ä»¥ä¸ã®ã¨ããã
sudo apt install w3m
ãªããw3mã§ãç»åã表示ããããå ´åã¯ã以ä¸ã®ã¨ãã w3m-img ãã¤ã³ã¹ãã¼ã«ããã
sudo apt install w3m-img
w3mã®Tips
ãHããã¼ã§ãã«ã
w3mã®ãã¼æä½ã¯é£ãããªãããæ £ããã¾ã§ã¯ãHã(大æåã®H)ãã¼ã§ãã«ããã§ãã®ã§ãããããªããã¼ã¯åç §ã§ããã
æååãããã
ãããããªãµã¤ããw3mã§é²è¦§ãã¦ããã¨ãæååããã¦ãã¾ããµã¤ããããã
ãããªæã«ã¯ãã=ããã¼ãæ¼ãã¦ããã®ãµã¤ãã®æ
å ±ã表示ãããDocument Charsetãã®æã®æåã³ã¼ããå¤æ´ãããChangeããæ¼ãã
å¤æ´ããæåã³ã¼ããé©åãªãã°ãã¡ããã¨è¡¨ç¤ºãããããã«ãªãã
ããã§ãè¦ããªããèªããªãâ¦
æåã³ã¼ããå¤æ´ãã¦ããç»åããããããããµã¤ãããjava ã¹ã¯ãªãããç¨ãããµã¤ãã§è¦ã«ãããã¨ãããã
ãããªæã«ã¯ããMã(大æåã®M)ãã¼ãæ¼ãã¦ãchromeçã®ãã©ã¦ã¶ãèµ·åããã
ãªããw3mã®ããã©ã«ãã§ã¯ããoã(ãªãã·ã§ã³)ã®ãå¤é¨ãã©ã¦ã¶ãã®è¨å®ããã/usr/bin/mozillaãã ããã/usr/bin/google-chrome &ãã¨æå¾ã«ã&ããä»ãããã¨ã«ããããã©ã¦ã¶èµ·åå¾ãããã«w3mã«æ»ã£ã¦æä½ãããã¨ãã§ããããã«ãªãã
Â
w3mã®èµ·åã¨ããã¹ããã¡ã¤ã«ã®æ´»ç¨
w3mã®èµ·åæ¹æ³ã«ã¯ãããã¤ãããããçè ã®æ°ã«ãã£ã¦ããã®ã¯ã以ä¸ã®3ã¤ã®ãã¡ä¸çªä¸ã®ä¸ã®æ¹æ³ã§ããã
$ w3m bookmark.txt ã«ã¬ã³ããã£ã¬ã¯ããªã®bookmark.txtãéã
$ w3m . ã«ã¬ã³ããã£ã¬ã¯ããªã®ãã¡ã¤ã«ãä¸è¦§
$ w3m -B w3mã®ããã¯ãã¼ã¯ãéã
1çªç®ã®æ¹æ³ã®ããã¹ããã¡ã¤ã«ã®ååã¯ããªãã§ãæ§ããªãããããã§ã¯ãä¾ã¨ãã¦bookmark.txtã¨ãã¦èª¬æããã
試ãã«ã以ä¸ã®å
容ã®bookmark.txtããã¼ã ãã£ã¬ã¯ããªã«ä½æãã¦ãã ããã
===== files
.
/usr/share/doc/w3m/ja/
file:///home/hoge/.vimrc
file:///home/hoge/ .emacs
file:///.w3m/bookmark.htnl â w3mã®ããã¯ãã¼ã¯
file:///.mozilla/firefox/xxxxx.default/bookmarks.html â firefoxã®ããã¯ãã¼ã¯
===== url
http://www.google.co.jp/
http://www.yahoo.co.jp/
åç´ãªããã¹ããã¡ã¤ã«ãªã®ã§ã好ããªãã¡ã¤ã«ãè¨å
¥ãã¦ãã ããã
ã©ããªã«ãã£ã¬ã¯ããªé層ãæ·±ãã¨ããã®ãã¡ã¤ã«ã§ãã/ããã®çµ¶å¯¾ã¢ãã¬ã¹ãè¨è¼ãããã¨ã
bookmark.txtã®æºåãã§ããããw3mãèµ·åããã
$ w3m bookmark.txt
ãªãã®å¤å²ããªãé常ã®ããã¹ããã¡ã¤ã«ã¨ãã¦ãbookmark.txtãéãããã
éæ³ã®ãã¼ã:ã
w3mã«ã¯ãéæ³ã®ããã«ä¾¿å©ãªãã¼ãããã
ã:ãã¯ãurlããªã³ã¯ã«ãããã¼ã§ãã
ä¸è¨ã®ä¾ã§ã¯ãgoogleã¨yahooã«ã¸ã£ã³ãã§ããããã«ãªãã
éãããã¡ã¤ã«ããããã¹ããã¡ã¤ã«ãhtmlãã¡ã¤ã«ã§ããå ´åã¯ãã¨ãã£ã¿ãèµ·åãã¦ãç·¨éãããã¨ãã§ããã
ãEãã§ã¨ãã£ã¿ãèµ·åããç·¨éã»ã¼ãå¾ãåã³w3mã«æ»ã£ã¦ãããã¨ãã§ããã®ã§
bookmark.txtã«ãã¡ã¤ã«çã追å ãããå ´åã¯ã便å©ã§ããã
èµ·åãç°¡åã«
æ¯åããw3m bookmark.txtãã¨å
¥åããã®ã¯ãé¢åã§ããã
ããã§ã以ä¸ã®ãããªshellã¹ã¯ãªãããæºåããã¨èµ·åãç°¡åã«ãªãã
#! /bin/sh
# w3 for w3m written by H.Yamada 2000/03/20
if [ "$*" != "" ]; then
w3m $*
else
w3m bookmark.txt
fi
çè ã¯ããã®ã¹ã¯ãªããããw3ãã¨ãã以ä¸ã®ããã«ãã¦å©ç¨ãã¦ããã
$ cp w3 ~/bin
$ chmod +x bin/w3
é常ã®å©ç¨ã§ã¯ããw3ãã¨å ¥åããhoge.txtãéãããæã«ã¯ããw3 hoge.txtãã¨ããã
(2013-03-09追è¨)
以åå©ç¨ãã¦ããæã«ã¯ãã;(ã»ãã³ãã³)ãã§ããã¹ãå«ãããã¡ã¤ã«åå
¨ä½ããªã³ã¯ã¨ãªãã便å©ã ã£ãããä»å試ããã¨ããããã¾ãåä½ããªãã^^;
ã¿ããå©ç¨ãã
w3mã§é²è¦§ä¸ã«ãç¨èªãåèªã®æå³ã調ã¹ãããªããã¨ã¯å¤ã
ããã¨æãã
çè
ã¯ãgoogleã®æ¤ç´¢ãå¤ç¨ããã®ã§ãèµ·åæããgoogleãæ°ããã¿ãã¨ãã¦éãã¦ããã°ãããããã¨ä¾¿å©ã§ããã
w3mã«ã¯ãã¿ãæ©è½ãããã®ã§ãèµ·åæããæ°ããã¿ãã§googleãéãããã«ããã
ã³ãã³ãã¨ãã¦ã¯ãä¸è¨ã§è¯ãããå ¥åãé¢åãªã®ã§ä¸è¨ã¹ã¯ãªãããå°ãå¤æ´ããã
#! /bin/sh
# w3 for w3m written by H.Yamada 2000/03/20
if [ "$*" != "" ]; then
  w3m $*
else
  w3m -N bookmark.txt www.google.co.jp
fi
ããã§ãæåã®ã¿ãã«ãbookmark.txtã次ã®ã¿ãã«googleãå¼ã³åºãããæåã«æ¸ããboobkmark.txtã表示ãããã
åºæ¬çãªãã¼æä½ã¨ãã¦ã¯ãã}ãã§æ¬¡ã®ã¿ããã{ãã§åã®ã¿ãã«ç§»åã§ããã
w3mã®è¨å®ã§ãããã¦ã¹ã使ããè¨å®ã«ãã¦ããå ´åã¯ãã·ãããæ¼ããªããããã¦ã¹ããã©ãã¯ãããã¨ã§ãæåãé¸æãããã¨ãå¯è½ã§ããã
å®éã«ã¦ã§ããé²è¦§ä¸ã«googleæ¤ç´¢ããå ´åã®ãã¼æä½ã以ä¸ã«ç¤ºãã
- webãé²è¦§ä¸ã«ã調ã¹ããåèªãshiftãæ¼ããªããããã©ãã¯ãã
- googleã®ã¿ãããã¦ã¹ã§ã¯ãªãã¯ãã¦ãéã
- googleã®ãã¼ã¯ã¼ãå ¥åã§Enterãæ¼ãããã¦ã¹ã®ä¸ãã¿ã³ã§æ¤ç´¢ãããè¨èããã¼ã¹ãããEnter
- tabãã¼ãæ¼ãã¦ãæ¤ç´¢éå§
ã¡ãã£ã¨ãé¢åã ããå°ãã¯ä¾¿å©ã«ãªããã¨â¦ ^^;
ããå°ã便å©ãªæ¹æ³ã¯ãä¸ã®ç¯ã§èª¬æããã
ãã¼ã«ã«CGIã®æ´»ç¨
w3mã«ã¯ããã¼ã«ã«CGIã¨ããæ©è½ããããw3mã®æ©è½ãæ¡å¼µãããã¨ãã§ããã
æ¬æ¥ã®ãã¼ã«ã«CGIã¯ãã¦ã§ããµã¤ãã§è¨å®ããCGIã®ãã¹ãã«ç¨ããããã®ç¨ã ããçè
ã®ç°¡åãªæ´»ç¨æ³ã以ä¸ã«ç¤ºãã
ãã¤ã§ãgoogleæ¤ç´¢
ãµã¤ããé²è¦§ãã¦ããã¨ãgoogleã§é¢é£ã®æ
å ±ãæ¤ç´¢ããããªããã¨ã¯ãè¯ãããã¨æãã
w3mã®ããã¥ã¡ã³ãã®ä¸ã«ã¯ã便å©ãªCGIã®ãµã³ãã«ã«é¢ããè¨è¿°ãããã
ãã®ä¸ã§ãgoogleã®æ¤ç´¢ãç°¡åã«ããæ¹æ³ã示ãã
ãã¡ã¤ã«åã¯ãªãã§ãè¯ãããä¾ã¨ã㦠google.cgi ã¨ãããã¡ã¤ã«ãä½æããã
#!/bin/sh
google_q='http://google.com/search?btnG=Google&q'
cat <<_END_
Content-type: text/plain
W3m-control: GOTO $google_q=$QUERY_STRING
W3m-control: DELETE_PREVBUF
_END_
 ä¸è¨ãã¡ã¤ã«ãä½æãããã~/cgi-binã¨ãããã£ã¬ã¯ããªãä½æããã
ä½æããcgi-binã«ããã¡ã¤ã«ã移åããå®è¡æ¨©ãä¸ããã
$ mkdir ~/cgi-bin
$ mv google.cgi ~cgi-bin
$ chmod +x ~/cgi-bin/google.cgi
次ã«ãw3m ãèµ·åãã¦ããoãã§ãªãã·ã§ã³ã¡ãã¥ã¼ãéãã
ã¾ããã~/cgi-binã§è¡¨ããããã£ã¬ã¯ããªãã«ãã/home/username/cgi-binãã¨å
¥åã
ç¶ãã¦ãè¾æ¸ãããgoogleã便å©ã«æ¤ç´¢ãããå ´åã¯ãè¾æ¸å¼ãã³ãã³ãã®URLã«ãfile:/cgi-bin/google.cgiãã¨è¨å
¥ããã
ã¡ãªã¿ã«ãå ã«æ»ãããå ´åã¯ãè¾æ¸å¼ãã³ãã³ãã¯ããfile:///$LIB/w3mdict.cgiã(çè ã®åå¿é²)ã
ããã§ã¯ãå®éã«ã«ã¼ã½ã«ã®åèªãgoogleæ¤ç´¢ããã
- ãTãã·ãããæ¼ããªãããæ°ããã¿ããéã
- æ¤ç´¢ãããèªã¾ã§ã«ã¼ã½ã«ã移åãããM-Wããæ¼ãã
- googleæ¤ç´¢çµæã表示ãããã
æ°ããã¿ããéãã¦ãããgoogleæ¤ç´¢ãããã¨ã«ãããå ããé²è¦§ãã¦ãããµã¤ããæ¶ããã«æ¤ç´¢ã§ããã®ã§ãå°ã便å©ã
çè ã®ã²ã¨ããã¨:
W3m-control ãå©ç¨ãã¦ããããªãã¿ããéãã¦ãgoogleæ¤ç´¢ãããã£ããæ¤ç´¢åã®ãããã¡ãæ®ã£ã¦ãã¾ãããã¾ãåä½ãããããªãã£ãã
ã©ãªãããã¹ãã¼ããªæ¹æ³ãæãã¦ãã ããã
ãã¼ã«ã«CGiã®ããã«é«åº¦ãªä½¿ãæ¹ã«ã¤ãã¦ã¯ã以ä¸ã®ãµã¤ããåç §ãã¦ãã ããã
shellãrubyçã®ã¹ã¯ãªãããæ´»ç¨ãã
ãã¼ã«ã«CGIã¯å¤§å¤ä¾¿å©ã ããããããã®è¨èªãè¦ããããªãã¸ãããªçè
ã«ã¯ãã使ãã«ããå°è±¡ãæã£ãã
ããã§ãw3mããshellãrubyã¹ã¯ãªãããå©ç¨ããæ¹æ³ãè¨è¼ããã
w3mãããå¤é¨ã®ã³ãã³ããå¼ã³åºãæ¹æ³ã¯ãã!ããã¼ã§ããã
w3mãèµ·åãã¦ã以ä¸ã®ããã«å¤é¨ã³ãã³ããèµ·åãã表示ã確èªããã
! ls -l
! pwd
ä¸è¨ã³ãã³ãã¯ããã¾ãå½¹ã«ç«ããªããã以ä¸ã®ã³ãã³ããå®è¡ããã
ä¸è¨ç°å¢å¤æ°ã®ä¸ã§ãW3M_URLã¯ã¡ãã£ã¨ä½¿ãããã
ããã§ã¯ãç¶ãã¦ã以ä¸ã®ã³ãã³ããå
¥åã
æå¾ã®ããvi -ãã®ã-ããå¿ããã«ã
é²è¦§ãã¦ãããµã¤ãã®URLã1è¡ç®ã«å ¥åããã¦ãviã¨ãã£ã¿ãèµ·åããã
ãã®æ©è½ã使ãã°ãé²è¦§ä¸ã«ãµã¤ãã®URLãç¨èªã®ã¡ã¢ãã¨ãã®ã«ä¾¿å©ã«ä½¿ãããã ã
Â
ããã§ã¯ã~/.w3m/keymap ã¨ãããã¡ã¤ã«ãä½æãã以ä¸ã®ã³ãã³ããè¨å ¥ããã
w3mã§ã¯ãEXEC_SHELL ã³ãã³ãã«å
容ãæ¸ããã¨ã«ãããw3mã®ä¸ããã³ãã³ããèµ·åãããã¨ãã§ããã
ä¸è¨ã®è¨è¿°ã®å ´åã¯ããAãã¨ããæåãå
¥åããã
å®éã®æ´»ç¨ã§ã¯ã以ä¸ã®ãããªæé ã«ãªãã
- ã¡ã¢ãã¨ãããé¨åãé¸æãã¦ãã³ãã¼
- ãAããã¼ãæ¼ãã¦ãvi ã¨ãã£ã¿ãèµ·åãããã¼ã¹ã
å¾ã§ãã¡ã¢ãè¦ãæã«ããw3mã§ã¿ãã°ãURLã®é¨åã§ã:ããã¼ãæ¼ãã°ããªã³ã¯ã«ãªã£ã¦ãç°¡åã«URLã¸ã¸ã£ã³ãã§ããã
ãããããªæ©è½ãå²ãå½ã¦ãããã«ã¯ã空ãã¦ãããã¼ã®æ
å ±ãå¿
è¦ã ã
以ä¸ã¯ãçè
ãããå æ¸ã«èª¿ã¹ãæ©è½ã®å²ãå½ã¦ããã¦ããªããã¼ã§ããã
w3mã«å²ãå½ã¦ãç¡ãã¦ããä»ã®ã¿ã¼ããã«ãgnomeçã®ç°å¢ã§ãå©ç¨ããã¦ãããã¨ãããã®ã§ãå®éã«ç¢ºèªããªããè¨å®ãããã¨ã
A,C,O,X,Y
M-d,M-f,M-g,M-h,M-i,M-j,M-q,M-r,M-x,M-y,M-z
M-A,M-B,M-D,M-E,M-F,M-g,M-H,M-J,M-L,M-O,M-P,M-Q,
M-R,M-S,M-T,M-U,M-V,M-X,M-Y,M-Z
M-;,M-.,M-,,M-/,M-@,M-^,M-\
w3mã§Twitter (2008-0520追è¨)
w3mã§ãTwitterãè¦ããã¨ã¯ã§ãã¾ãããæ稿ã¯ã§ããªãããã§ãã
ããããã¢ãã¤ã«çã®Twitterã«ãã°ã¤ã³ããã°ãæ稿ãå¯è½ã§ãã
ã¢ãã¤ã«çã®Twitterã¯ã以ä¸ã®URIã§ã¢ã¯ã»ã¹ã§ãã¾ãã
ãããã«
å®ã®ã¨ããããã®ãã¼ã¸ãã¢ããããã®ã¯ãw3m.vim ã¨ãã vim ã¹ã¯ãªãããè¦ã¤ããããã ã
ã¡ãã£ã¨ä½¿ã£ã¦ã¿ãç¯å²ã§ã¯ãã¨ã¦ãé«éã§å¿«é©ã§ããã
w3m.vimã®ã¤ã³ã¹ãã¼ã«ã使ãæ¹çã«ã¤ãã¦ã¯ãè¿ã ã¢ããããäºå®ãªã®ã§ãã¾ããããããé¡ããã¾ãã