2020年1月10日 星期五

自動搜尋不同網頁 - 輸入一個單字, 自動搜尋多個德文字典網頁

自動搜尋不同網頁 - 輸入一個單字, 自動搜尋多個德文字典網頁

有時候一個關鍵字想從不同的地方搜尋, 每次都要複製貼上有點小麻煩, 所以弟就寫了一個簡單的 Javascript 自用. 主要目的是在不同的網頁查詢相同的德文單字, 學習德文用, 下載連結在此 Github [ link ]


預設查詢的德文字典有
1. 德語助手
2. LEO
3. DWDS
4. Duden

然後可以自行勾選是否也一起查詢下列網頁
1. PONS
2. Linguee
3. Bing

使用方法很簡單, 打如要查的單字, 例如 "machen"
然後按下 enter 就好了

注意:
1. Chrome 會擋 pop-up, 所以第一次使用的時候, 要手動把 pop-up 打開, 在右上方的小 icon
2. Duden 會分大小寫, 所以查詢名詞的時候建議第一個字用大寫, 例如 "Haus"


也可以自行修改成 中英搜尋, 或者其他用途, 歡迎自行分享修改,
有什麼疑問也歡迎留言讓宅宅知道



ps. 因為有人反映說不知道怎麼從github 下載, 所以我把原始碼post 在這邊, 用記事本複製貼上, 並且存檔成 .html 就可以了,  請底下原封不動複製

<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="background-color:black">
<font color="white" size="5">
<p> 德文有這麼難嗎?!</p>
<p> > Search : </p> </font>
<input type="text" id="boxu" autofocus="">
<font color="white">
<p> PONS <input type="checkbox" id="pons">
Linguee <input type="checkbox" id="linguee">
Bing <input type="checkbox" id="bing"> </p>
</font>
<font color="white">
<p> 1. ich bin / du bist / er,sie,es ist / wir sind / ihr seid / sie,Sie sind </p>
<p> 2. ich mich mir / du dich dir / er ihn ihm / sie sie ihr / es es ihm / wir uns / ihr euch / sie,Sie (s)ie (i)hnen : Dativ比較白目 </p>
<p> 3. der die das die / den die das die / dem der dem den / des der des der</p>
<a href="https://mulderwei.blogspot.com/">宅宅該做宅宅該做的事</a>
</font>
<script>
document.getElementById("boxu").onkeydown = function(e) {searchy(e)};
function searchy(e)
{
if (e.which == 13)
{
var q = document.getElementById("boxu").value;
if (document.getElementById("bing").checked == true) {
window.open("https://www.bing.com/search?q=" + q);
}
if (document.getElementById("pons").checked == true) {
window.open("http://en.pons.com/translate?q=" + q + "&l=deen&in=&lf=de");
}
if (document.getElementById("linguee").checked == true) {
window.open("http://www.linguee.com/english-german/search?source=auto&query=" + q);
}
window.open("https://www.godic.net/dicts/de/" + q);
window.open("http://dict.leo.org/german-english/" + q);
window.open("https://www.dwds.de/?q=" + q);
window.open("http://www.duden.de/rechtschreibung/" + q);
document.getElementById("boxu").value = "";
}
}
</script>
</body></html>

記得存檔的時候要存成 .html, 然後開啟這個檔案就可以了







//
覺得內容有幫助的話, 麻煩請幫按一下Google提供的廣告

沒有留言: