åº
ãã£ããã®éçºãããã¦äºåçææ¦ç¥ã«å°éããä¸ãã¯ãªãã©ãæ¸ãã¦ãããããããé常ã«é©å½çã§ããæ¥µãã¦ã·ã³ãã«ã«ãããã¨ãã§ãããã¨ãã話ã¯ããã ãã§ã¯ãã³ã¨ããªãã®ãæ®éã ãããããã³ã¼ããæ·»ãã¦è§£æ±ºãããã¨ã«ããã
äºåçææ¦ç¥
PureBuilder Simplyã§æ¡ç¨ããã¦ãããäºåçææ¦ç¥ãã¯ãç§ã«ã¨ã£ã¦ã¯ã¦ã§ãã¢ããªã±ã¼ã·ã§ã³éçºã«ãããã¦ãªã®ã²ã¨ã¤ã«ãªã£ã¦ããã
ãã®å 容ã¯ãåºæ¬çã«ãã¦ã¼ã¶ã¼ãè¦æ±ãããã®ã¯éçHTMLã§ããããã«ãããã¨ãããã¨ã§ããã
ããã«ã±ã¯Nginxã ã£ãã 2005å¹´ã«ã¯ããåãçµã¿å§ãã¦ããã®ã ãããããªãæåº¦ã¯é«ãã£ãã¨ãããã ããã
彿ãç§ã®webãµã¼ãã¼ã¯Apache 1.3ã ã£ãããçµå±ã¯ãã®ãã¨Lighttpdã¸ã®ç§»è¡ãããã¨ã«ãªãã ããã¦ãã®å¾ã¯ã¾ããã®DeleGateã¸ã¨å ç¥è¿ãããã
ã ããNginxãæ¤è¨ããã®ã¯ãéçãã¡ã¤ã«ã®å¿çé度ãéè¦ãã¦ãããã¨ããè¨è¨ã®ããã ã
2005å¹´ã«ã¯ãADSLã®æ®åã«ããåç·é度ãã ãã¶åä¸ãã¦ãããçµæçã«ã徿¥ã§ã¯èããããªãããããã£ããã«å¯¾ãããªã¯ã¨ã¹ããå¢å¤§ããã¨ããåé¡ãçºçãã¦ããã ã¡ãªã¿ã«ã彿ã®HTMLãã£ããã¨ããã°ããã¿ããªã§ã¢ã¯ã»ã¹ããã¨ã¨ã©ã¼ã«ãªããã®ãã§ããããã°è¡¨ç¤ºãããããã£ãããçºè¨ãæ¶ãããããã¼ã¸ãåå¾ã§ããªãã£ããã¨ãããã¨ã¯æ¥å¸¸çã«ãã£ãã
ã ããããããwebãµã¼ãã¼ã¯éçãªãã¼ã¸ãé ä¿¡ããã®ãæãåºæ¬ã§ãããéçãªãã¼ã¸ã«ãããã¨ã§å¤ãã®åé¡ã解決ãããã®ã¨æãããã ãããããéçãªãã¼ã¸ãåå¾ããã®ã§ããã°ãCGIã¹ã¯ãªããã¯èµ·åããããè² è·ã¯ã¨ã¦ãå°ãªãã ã¾ããã»ãã¥ãªãã£ä¸ã®ãªã¹ã¯ãªã©ã(webãµã¼ãã¼ãèªåã®è²¬ä»»ã§ä¿å®ãã¦ããã®ã§ã¯ãªããªã)èããªãã¦è¯ãã
å°ãªãã¨ããéçãã¼ã¸ãé ä¿¡ãããã¨ã¯ã»ãã¥ãªãã£ä¸ãããã©ã¼ãã³ã¹ä¸ãè¯ããã¨ã§ããã®ã¯ç¢ºãã ã
ãã£ããã§äºåçææ¦ç¥
ããããããã£ããã§åé¡ãèµ·ããçç±ã¯ããæ°ããçºè¨ãåå¾ãããã¨ãã¦ãªãã¼ããã¿ã³ã飿ãããããã§ãããä¸ç¨®ã®F5ã¢ã¿ãã¯ã仿ãããã¨ã«ãªãããã ã
ä»®ã«F5ã¢ã¿ãã¯ããããããªãã¨ãããªãã°ãæ´æ°ããããã®ãéçHTMLã§ããã°ã¹ã¯ãªãããå¼ã°ãããã¨ã¯ãªããéå軽ããªãã
ç§ã¯ããããããã£ããã¹ã¯ãªããã¯éåé·ãéçºã«åãçµãã§ããã ãã®ç®çã¯æ¢åã®ããªã¼ã¹ã¯ãªãããå©ç¨ãã¦ããç¶æ³ããã®è±å´ã§ãããç§ãããã°ã©ãã³ã°ãåéããã¨ãã«ã¾ãè¡ã£ãã®ã¯ããã£ããã¹ã¯ãªãããæ¹é ãããã¨ãããã¦å¦ç¿ã®ä¸ç°ã¨ãã¦ããã(ç¹ã«Perl4ã§æ¸ããã¦ãããã®)ãã¢ãã³ã«æ¸ãæãããã¨ã ã£ãã
ç§ã®ãµã¤ãã§ã¡ã¤ã³ã§ä½¿ããã¦ãããã£ããã¹ã¯ãªããã¯ãããã¡ãã£ã¨2000ãã®ã¡ãTeaChatãã§ãããããµã¤ãå ¨ä½ã§ã¯é常ã«å¤ãã®ãã£ããã¹ã¯ãªãããåä½ããã¦ããã ããªã¼ã¹ã¯ãªãããæ¯è¼ããã¨åæã«ãç§ã®éçºãã¹ãã§ããã£ãã èå°ã¨ãªã£ãã®ã¯freewebãããã¦ããªããã!ã§ããã
ããã°ã©ãã³ã°è¨èªãå¦ç¿ããéç¨ã§ããããã®è¨èªã«é©ããå½¢ã§ãã£ããã¹ã¯ãªãããåå®è£ ãããã¨ããç®æ¨ãããã å¶ä½ãããTeaChatã®ã¯ãã¼ã³ã¹ã¯ãªãããã¯ãPerl5(ãªãã¸ã§ã¯ãæåç), Ruby 1.8, PHP5, Python 2.4ã¨ãªããªãå¤ãã
TeaChatã®ã¯ãã¼ã³ã¹ã¯ãªãããæ¸ãä¸ã§æããã®ã¯ã ããã£ããã¹ã¯ãªããã¯çµå±ã®ã¨ãããçºè¨ããã£ãã¨ãã¯ãã°ãæ´æ°ããã¨ããæä½ãããããããã§ãªãã¨ãã¯ãã°ãèªãã§HTMLããã«ããã¦ããã ãã§ãããã¨ãããã¨ã ã
ãã®æ°æã¡ãããå¼·ããªã£ãã®ã¯ãeRubyãå¦ãã ã¨ãã ã£ãã ãã£ããã®ãã¼ã¸ã¯ãeRubyã¨ã³ã¸ã³ãeRubyãã³ãã¬ã¼ãããã°ãã¡ã¤ã«ãããã°çæå¯è½ã§ãããRubyã¹ã¯ãªããã¯å¿ è¦ã¨ããªãã ã ããTeaChatã«æºããã¨ãããããRubyã¹ã¯ãªããã§ãããããããã¦ããeRubyã¨ã³ã¸ã³ãå¼ã³åºããã¨ã«ãªãã
ããã¦ãä½åº¦ãä½åº¦ããªãã¼ãã«ãã£ã¦HTMLããã«ããããã¨ã«ãªãã®ã ããæ´æ°ããã®ã¯çºè¨ããã¨ãã ãã§ããããã«ãããé »åº¦ã«å¯¾ãã¦æ´æ°ããé »åº¦ã¯æ¥µãã¦ä½ãã æ´æ°ããã¦ããªããã°ãå ¨ãåãå 容ã®ãã¼ã¸ããã«ããã¦ããããã§ãããããã¯ããã®ä¸ãªãã»ã©ç¡é§ã ã
ã ã£ãããæ´æ°ããã£ãã¨ãã ãHTMLãæ´æ°ãã¦ãã¦ã¼ã¶ã¼ã¯HTMLãèªãã°ããã§ã¯ãªããã
çµæçã«ã¯ããã¬ã¼ã ã ãã§ãªããçºè¨ç¨ãã¼ã¸ãããã£ãããã¼ã¸ãå ¨ã¦éçHTMLã¨ããè¨è¨ãã§ãããã£ãã å¯ä¸ãçºè¨ãã©ã¼ã ã®submitå ãCGIã§ãããããã¯å½åã¯éçHTMLãã®ãã®ãç·¨éãããã¨ãããã®ã ã£ãã ã®ã¡ã«ãeRubyã使ã£ã¦ãã°ããçæããè¨è¨ã«å¤æ´ãããã
å ·ä½ãªã³ã¼ã
彿ã®ã³ã¼ãã¯æ®ã£ã¦ããªãããGitHubã«ãã®æ¦è¦ãå®è£ ãããã®ãä¸ããã
TeaChatã»ã©é«æ©è½ãªããã§ã¯ãªããã彿ã®HTMLãã£ããã¨ãã¦åºæ¬çãªæ©è½ã¯åãã¦ããã Perlã®ãã£ããCGIã¯å°ããªãã®ã§ã300è¡ç¨åº¦ã¯ãã£ããã¨ãèããã¨ã39è¡ã¨ããã®ã¯é©ç°çãªå°ããã§ããã ãããããã®ã¹ã¯ãªããã¯Webrickãµã¼ãã¬ããã«ãªã£ã¦ããããµã¼ãã¼æ©è½ããèªåã§è³ãã
æ¬è³ªé¨åã¯ããã8è¡ã§ã
cgi = req.query
chat.unshift({name: esc(cgi["name"]), timestamp: Time.now.strftime("%y-%m-%d %T"), chat: esc(cgi["chat"])&.[](0, 1024)})
chat = chat[0,30]
File.open("chat.log", "w") do |f|
Marshal.dump chat, f
end
chat_content = ERB.new(CHAT_HTML).result(binding)
File.open("chat.html", "w") {|f| f.puts chat_content}ã¨ãªã£ã¦ãããããã§ã¯
- ãã©ã¡ã¼ã¿ãèªã¿è¾¼ã¿
- ãã©ã¡ã¼ã¿ããªãã¸ã§ã¯ãåãã¦ãã£ãããã°ã«è¿½å ã
- ãã°ãä¿åãã¦
- HTMLã«ãã«ããã¦
- HTMLãã¡ã¤ã«ã¨ãã¦ä¿åãã
ã¨ããæé ã§ããã
ãªãã¼ãééã¯5ç§ã¨çãããæåã§é£æãããããã¯ã¯ããã«ãã·ãªã®ã§ãæåã§ã¯ããã«ãã仿§ã«ãªã£ã¦ããã
äºåçææ¦ç¥ãã¨ããã¨ã§ã³ã¼ããçããªãããã°ã®ä½å°ãæ¸ã£ãã ããã¦ãè¨è¨èªä½ãåç´ã«ãªãè¦éãããããªã£ããåºæ¬çã«ãè¯ããã¨ã¥ããã§ããã
äºåçææ¦ç¥ã®å¿ç¨
ã§ã¯ããã®ãããªäºåçææ¦ç¥ãæå¹ãªã±ã¼ã¹ãèãã¦ã¿ãã
æ²ç¤ºæ¿ã·ã¹ãã ãªã©ã¯ãããèªããã¨ãå¤ããããé©ãã¦ããã ãã®ããã«èãã¦ããã¨é常ã«å¤ãã®ã±ã¼ã¹ã«ä½¿ããã¨ãããã¨ããããã
ãªã«ããããããã®ããããã°ã®ãããªçºä¿¡åã®ã³ã³ãã³ãã ã
ãã®ãããªãã®ã¯å½æããã¼ã¸ãã¹ã¿ãªã³ã°ã·ã¹ãã ã¨å¼ã°ãã¦ããã ãã®è¦ç¹ã¨ãã¦ã¯ããã³ãã¬ã¼ãããããã¨ã§ãã¼ã¸ããããªã©å ±éã®é¨åãä¸ç®æã«ã¾ã¨ããã³ã³ãã³ãé¨åã ããç°ãªããã®ãæ¸ãããã¨ãããããªãã¨ã ã
ããããããã°ã·ã¹ãã ã§ããã使ãã®ã¯æããã«éå°ã§ããã ç¾å¨ã§ããã°ãPandocã§ããããã¯å¶ããããã®ã ã
ãã®ãã¨ãããããã³ãã¬ã¼ãæ©è½ã®ãµãã¼ãããPODã®ãããªããç°¡åã«ã³ã³ãã³ããè¨è¿°ã§ããè¨èªã®ãµãã¼ããã®2ç¹ããã¼ãã«ãªã£ãã åè ã¯PureBuilderã¨ãã¦ãå¾è ã¯PureDocã¨ãã¦å®è£ ããããã¨ã«ãªããããã«ãè¨äºã®åå¾é¢ä¿ãããããããã¨ãç®æ¨ã¨ããã®ãACCSã ã
ãããã®å¤§ããªã¡ãªããã¨ãã¦ãäºåçææ¦ç¥ãªãã§ã¯ã®ã軽ããã ãã§ãªããå®è£ ã容æã§ããããªããã¤å®å ¨ã§ããã¨ãããã¨ããããã
ã¾ãããã°ã¤ã³æ©è½ãç®¡çæ©è½ãªã©ãå®è£ ããå¿ è¦ããªãã åç´ã«ãã¡ã¤ã«ã¨ãã¦çæãããã®ãªã®ã§ãããã¡ã¤ã«ã®ç·¨éãã¨ããæ¦å¿µã«å¸åãããã ããã§å®è£ ãã¨ã¦ã楽ã«ãªãã
ããã«ãwebã«å¯¾ããæ»æã¨ããã®ã¯ã»ã¨ãã©ãå®çªwebã¢ããªã±ã¼ã·ã§ã³ã®æ©è½ãèµ·åãããã¨ãããããã°ã¤ã³ã試ã¿ããã®ã§ãããããåãªãéçHTMLãã¡ã¤ã«ã§ã¯æ»æã®èµ·ç¹ããªãã é常ã«ã»ãã¥ã¢ã§ããã
ãäºåçææ¦ç¥ãã¨ããèãæ¹ããããã°ãããããæå ã§éçãã¡ã¤ã«ã«å¤æãã¦ãã¾ãPureDoc/PureBuilderã¯ããçºå±çãªèãæ¹ã§ãã£ãã ããã¨ã¯å¥ã«ãæ¤ç´¢ãã¼ã¸ã®ãããªãªã³ããã³ãã§æä¾ãããå¿ è¦ããããã®ã¯ãã®èãæ¹ãéç¨ããªããããããè² æ ã«ãªãå ´åããããã ãã®ããã«ããé å»¶çææ¦ç¥ãã¨ãããã®ãç·¨ã¿åºããããããã¯ããä¾ããã¼ã¸ãæ´æ°ãããç¶æ³ãèµ·ããã¨ãã¦ããæåã«ã¢ã¯ã»ã¹ãããã¾ã§ã¯ãã¼ã¸ãå®éã«ã¯æ´æ°ããªããã¨ãããã®ã§ããã ãã ãããèªä½ã¯ã»ã¨ãã©ãã³ã³ãã³ããã£ãã·ã¥æ©è½ãã¨å¤ããããªããããã»ã©ç¬ç¹ãªãã®ã§ã¯ãªããçæããã¹ããã©ããã夿ããããã«ããªã¯ã¨ã¹ãã¯ã¹ã¯ãªãããåãä»ããªãã¦ã¯ãªããªãããã ã å®éã«é å»¶çææ¦ç¥ãåã£ãã¢ããªã¨ãã¦ã¯Mongrelãç¨ãããµã¼ãã¬ããã¨ãã¦å®è£ ããããã®ãããã¤ããããããã£ãã·ã¥ã¨ãã¦ä»¥ä¸ã®å¹æã¯çºæ®ã§ããããã®è©±ã大ãã«ãããã¨ã¯ãªããªã£ãã
é·æ, æ¢æ±, æ±é
ä»ã«ãã¦ã¿ãã°æå¤ã«æããããããããªãããã©ãç§ã¯å½åãããå¤ãã£ãã³ã¼ãããããã©ãã³ã¼ãããæ¸ãã¦ããããã§ã¯ãªãã ããããç§ã¯å®ç§ä¸»ç¾©è ã ã£ããããã®ããããã£ã¡ãããã³ã¼ããå¦ç¿æã«ä½¿ç¨ãããã®ãæ£ããè¸ã¾ããã³ã¼ããæ¸ãã¦ããã
ã ãã彿ãã好å¥å¿ã¯å¼·ãã£ãããççã®æ¢æ±ã¨ããå¾åãå¼·ãã£ãããã£ããã¹ã¯ãªããã®åå®è£ ãç¹°ãè¿ãä¸ã§ããããã¯æ¬å½ã«å¿ è¦ã?ããããæ¸ããã»ããæ¬è³ªçã§ç«¯çãªã®ã§ã¯ãã¨ããçåãæ¬¡ã æ¹§ãä¸ããã 1å¹´ãããã¯èãã¦ããããçµå±ã¯å¾ã ã«ã¢ã¬ã³ã¸ãå ããããã«ãªã£ã¦ãã£ãã
ãå¥ã«ã¢ããªã±ã¼ã·ã§ã³ã§å¿çããå¿ è¦ã¯ãªããããªãããã¨ããã¨ããã«è³ãã®ããã®æµãã ã ãµã³ãã«ã§ã¯æ¬è³ªé¨åã ããæ¸ããã¨ããã¼ãã«ãã¦ããããå®éã«ã¯TeaChatã«åå¨ããæ©è½ã¯å ¨ã¦ç¶²ç¾ ãããã®ãå¶ä½ããã TeaChatã«ã¯é»å ±æ©è½ããããããã¯private messageã§ãããã¤ã¾ãããã¦ã¼ã¶ã¼åºæã®ãã£ãããäºåçæãããã¨ããæ¦ç¥ã«æåãã¦ãããã¨ãæå³ããã
ããã¯2ãã¼ã¸ã§ã³ãããæåã®ãã¼ã¸ã§ã³ã§ã¯ã¦ã¼ã¶ã¼ãã¨ã«åºæã®HTMLãã¡ã¤ã«ãéãããã«ãªã£ã¦ããã ãã¡ãã¯ããè¤éã§ã
- ãã¬ã¼ã ãã¼ã¸ã¨ãã¦ãã£ã¹ãããã£ãå¼ã°ãã
- ãã£ã¹ãããã£ã¯UIDãçæããUIDã®ãã£ã¬ã¯ããªã使ãã¦ãã¼ã¹ã¨ãªãHTMLãã¡ã¤ã«ãåºåãã
- ãã©ã¼ã ã«ã¯UIDå¤ãè¦ãã¦ãã
- å½è©²ãã£ã³ãã«ä¸ã§ä¸å®æéå ã«çºè¨ã®ãã£ãUIDãè¦ãã¦ããããã®UIDãæ´æ°å¯¾è±¡ã«ãã
å¯è½ãªéãæ¼ãããªã仿§ã§ã¯ããã®ã ããè¦ã¦ãããã¨ããå®å ¨ã§ã¯ãªãã é»å ±ãªã¹ãã®ããã«F5ããªããã°ãªããªãã¨ããã®ãæã大ããåé¡ã ãããã
å¾çºã®ä»æ§ã¯Ajax仿§ã§ãããXMLHttpRequestã使ãã HTMLå ã«ã¡ãã»ã¼ã¸IDãåãè¾¼ã¾ãã¦ããããã®ã¡ãã»ã¼ã¸IDãæªç¥ã®ãã®ã§ããã°ãXMLHttpRequestã«ãã£ã¦è¿½å ã§åå¾ãããåå¾ããã¡ãã»ã¼ã¸ã¯JavaScriptã«ãã£ã¦ã¿ã¤ã ã¹ã¿ã³ãã§ã½ã¼ããããã£ããã«æ··ãè¾¼ã¾ããã HeartComã§ã¯ãããçºå±ããå½¢å¼ã«ãªã£ã¦ãããPMç¨(ã¨ããããuser relemç¨)ã®ã¢ããªã±ã¼ã·ã§ã³ãç¬ç«ãã¦åå¨ãããããã¦XMLHttpRequestã«ãã£ã¦ãã¼ãªã³ã°ãè¡ããã¡ãã»ã¼ã¸ãåä¿¡ã§ããããã«ãªã£ã¦ããã
çµå±ãã®ãã£ããã«ãããäºåçææ¦ç¥æ¡ç¨ã転æ©ã«ãªã£ãã ãã®ã¹ã¯ãªããã¯ã常èããæ£ããã¨ããã¦ãããã¨ã¨ã¯å ¨ãç°ãªããã ããå®å ¨ã«æ£ããåä½ããæå³ãéæã§ããã
è³ã£ã¦æ¬è³ªçã ããã®äºå®ã¯ãæ¬è³ªã¯ç«¯çã«è¡¨ãããã¨ãããã¨ãæå³ãã¦ããããã®æ£èª¤èªä½ã¯çµæ1ã«ãã£ã¦è¨¼æã§ããã ã¾ããæ£ããåä½ããéãããããæ£ããã®ã§ãããä¸ã®ä¸ã§æ£ããã¨ããã¦ããææ³ã常èã¯ã©ã¡ããã¨ããã°ããã«ä¾åãã¦ãããã¤ã¾ãããæ£ããããæé©ã§ãããã©ããã¯å¥ãã§ããã
以éãç§ã¯ç«¯çãªã³ã¼ããç®æããã¨ã«ãªãã æ¬è³ªããªã«ããè¦æ¥µãããã¨ãã§ããã°ã³ã¼ãã¯åçã«çããªãããã¡ãããå ´åã«ãã£ã¦ã¯æ³¥èãã¦ã仿ãã¤ãæ¹æ³ã§è§£æ±ºããã»ããè¯ãå ´åãããã ã ããããã ãã§ã¯æé·ããªããã¨ã«ããã¿ã³ãçãªã³ã¼ããç®æããããããã§ããã ãçæéã§ãã ã ç§ã®åä¸ããæ±éãå§ã¾ã£ãã
ãã®æ±éã¯ãªã«ããäºåçææ¦ç¥ãã¨ãããã¯ããã¯ã«ã¨ã©ã¾ããä¸äºã«åãã ã éæ¹ããªãå°é£ã«æããããã¨ããä»ãªãã§ããã
çµæã¯ç¾è±¡ã§ããããã®ãçµæããã売ä¸ããã人æ°ãã§æ¸¬ããã¨ããã¨çå®ã«ã¯ãã©ãçããªããâ©ï¸