robot
最新文章(10)
Mqskit 和其它相關工具
CPython 的 GC 二、三事
寫 Mecurial Extension 是件快樂的事!
Mozilla 台灣辨公室徵人啟事
關於 Apple 的兩項專利
core dump 之前的 frame
怎麼發出 beep 聲?
先承認你要找的是奴才吧!
程式碼要清的多乾淨?
FreeBSD 的 Thread-Local Storage 實作
首頁
新編
最新留言
Entries RSS
重要關鍵字(10)
coding (122)
Python (93)
FreeBSD (71)
WEB (61)
URL (48)
hardware (46)
javascript (36)
Linux (34)
blog (30)
C++ (16)
所有關鍵字
新增 URL
單字查詢記錄系統
by thinker
2 Columns
關鍵字:
Python
應用
前一陣, 佇網路上看到一段 $javascript$: {{{ $javascript$:qr=new String(window.getSelection()); if(qr.length > 0) void(window.open('http://dictionary.cambridge.org/results.asp?searchword='+ escape(qr)+'&image.x=0&image.y=0', "dictionary", 'width=480,height=480,scrollbars=yes,status=yes')); else void(window.location = 'http://dictionary.cambridge.org'); }}} 將這段 $javascript$ 作成 bookmark, 就是一個真方便兮字典. 只要佇抺查兮字 double click, 將字 mark 起, 然後選上面兮 bookmark, 就自動送出查詢內容到 dictionary.cmbridge.org 這個網站. 線上字典雖然好用, 但是沒記錄兮功能, 無法$統計$你時常查兮字, 查詢兮次數. 所以我就想到將查詢送到自己兮 server 作記錄, 然後才 redirect 到字典網站. $javascript$ 就變成: {{{ $javascript$:qr=new String(window.getSelection()); if(qr.length > 0) void(window.open('http://heaven.branda.to/~thinker/dict/keepdict.py?func=search&target='+ escape('http://dictionary.cambridge.org/results.asp?searchword='+ escape(qr)+'&image.x=0&image.y=0'), "dictionary", 'width=480,height=480,scrollbars=yes,status=yes')); else void(window.location = 'http://dictionary.cambridge.org'); }}} 之後, 每次查字典攏會記錄落來. 連到 keepdict.py 無下任何耶參數, 就會列出最近三十次查詢兮單字.(請將 http://heaven... 一段換成汝兮 $URL$) 下面 freshwords 就是這個記錄系統, 用 $Python$ 寫兮! * attach:freshwords.tar.gz
最後更新時間: 2005-03-17 18:56:07 CST |
引用
查詢:
COMMENTS: