@vdegenne/links 1.8.14 → 1.8.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +9 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +13 -7
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export declare function chatGptUrl(question: string, voice?: boolean): string;
|
|
|
53
53
|
* You need the extension: https://chromewebstore.google.com/detail/chatgpt-hash/dammfmpccfehndicnhkmjjiipkhongfa
|
|
54
54
|
*/
|
|
55
55
|
export declare function chatGptOpen(question: string): void;
|
|
56
|
-
export declare function chatGptMediatorUrl(
|
|
56
|
+
export declare function chatGptMediatorUrl(question: string): string;
|
|
57
57
|
export declare function chatGptMediatorOpen(input: string): void;
|
|
58
58
|
export declare function googleUrl(input: string): string;
|
|
59
59
|
export declare function googleOpen(input: string): void;
|
|
@@ -65,9 +65,15 @@ export declare function googleMapsUrl(location: string): string;
|
|
|
65
65
|
export declare function googleMapsOpen(location: string): void;
|
|
66
66
|
export declare function lazyMapUrl(location: string, local?: boolean): string;
|
|
67
67
|
export declare function lazyMapOpen(location: string, local?: boolean): void;
|
|
68
|
-
export declare function textSelectorUrl(text: string
|
|
69
|
-
|
|
68
|
+
export declare function textSelectorUrl(text: string, options?: {
|
|
69
|
+
search: string;
|
|
70
|
+
}): string;
|
|
71
|
+
export declare function textSelectorOpen(text: string, options?: {
|
|
72
|
+
search: string;
|
|
73
|
+
}): void;
|
|
70
74
|
export declare function cropWithGamepadUrl(): string;
|
|
71
75
|
export declare function cropWithGamepadOpen(): void;
|
|
76
|
+
export declare function cnrtlUrl(word: string): string;
|
|
77
|
+
export declare function cnrtlOpen(word: string): void;
|
|
72
78
|
export {};
|
|
73
79
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index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AAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,QAEhD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/C;AACD,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,QAEvC;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG,GAAG,GAAG,UAExD;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG,GAAG,GAAG,QAEzD;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,UAEtC;AACD,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,QAEvC;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,UAE7C;AACD,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,QAE9C;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,UAAQ,UAOzD;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,UAAQ,QAE1D;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,UAEvE;AACD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,QAExE;AAED,wBAAgB,kBAAkB,WAEjC;AACD,wBAAgB,mBAAmB,SAElC;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,UAEpC;AACD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,QAErC"}
|
package/lib/index.js
CHANGED
|
@@ -169,9 +169,9 @@ export function chatGptUrl(question, voice = false) {
|
|
|
169
169
|
export function chatGptOpen(question) {
|
|
170
170
|
open(chatGptUrl(question));
|
|
171
171
|
}
|
|
172
|
-
export function chatGptMediatorUrl(
|
|
173
|
-
return `https://chatgpt-mediator.web.app/?q=${encodeURIComponent(
|
|
174
|
-
return `https://vdegenne.github.io/chatgpt-mediator/?q=${encodeURIComponent(
|
|
172
|
+
export function chatGptMediatorUrl(question) {
|
|
173
|
+
return `https://chatgpt-mediator.web.app/?q=${encodeURIComponent(question)}`;
|
|
174
|
+
return `https://vdegenne.github.io/chatgpt-mediator/?q=${encodeURIComponent(question)}`;
|
|
175
175
|
}
|
|
176
176
|
export function chatGptMediatorOpen(input) {
|
|
177
177
|
open(chatGptMediatorUrl(input));
|
|
@@ -212,11 +212,11 @@ export function lazyMapUrl(location, local = false) {
|
|
|
212
212
|
export function lazyMapOpen(location, local = false) {
|
|
213
213
|
open(lazyMapUrl(location, local));
|
|
214
214
|
}
|
|
215
|
-
export function textSelectorUrl(text) {
|
|
216
|
-
return `https://vdegenne.github.io/text-selector/?input=${encodeURIComponent(text)}`;
|
|
215
|
+
export function textSelectorUrl(text, options) {
|
|
216
|
+
return `https://vdegenne.github.io/text-selector/?input=${encodeURIComponent(text)}${options && options.search ? `#${options.search}` : ''}`;
|
|
217
217
|
}
|
|
218
|
-
export function textSelectorOpen(text) {
|
|
219
|
-
open(textSelectorUrl(text));
|
|
218
|
+
export function textSelectorOpen(text, options) {
|
|
219
|
+
open(textSelectorUrl(text, options));
|
|
220
220
|
}
|
|
221
221
|
export function cropWithGamepadUrl() {
|
|
222
222
|
return `https://vdegenne.github.io/crop-with-gamepad/`;
|
|
@@ -224,4 +224,10 @@ export function cropWithGamepadUrl() {
|
|
|
224
224
|
export function cropWithGamepadOpen() {
|
|
225
225
|
open(cropWithGamepadUrl());
|
|
226
226
|
}
|
|
227
|
+
export function cnrtlUrl(word) {
|
|
228
|
+
return `https://www.cnrtl.fr/definition/${encodeURIComponent(word)}`;
|
|
229
|
+
}
|
|
230
|
+
export function cnrtlOpen(word) {
|
|
231
|
+
open(cnrtlUrl(word));
|
|
232
|
+
}
|
|
227
233
|
//# sourceMappingURL=index.js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CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAY;IAC3C,OAAO,mDAAmD,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC;AACtF,CAAC;AACD,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC5C,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,kBAAkB;IACjC,OAAO,+CAA+C,CAAC;AACxD,CAAC;AACD,MAAM,UAAU,mBAAmB;IAClC,IAAI,CAAC,kBAAkB,EAAE,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["/**\n * @license\n * Copyright (c) 2023 Valentin Degenne\n * SPDX-License-Identifier: MIT\n */\n\nfunction open(url: string, newTab = true) {\n\tif (newTab) {\n\t\twindow.open(url, '_blank');\n\t} else {\n\t\twindow.open(url);\n\t}\n}\n\n/**\n * Google related links\n */\n// google images\nexport type GoogleImagesSize =\n\t| 'l'\n\t| 'm'\n\t| 'i'\n\t| 'qsvga'\n\t| 'vga'\n\t| 'svga'\n\t| 'xga'\n\t| '2mp'\n\t| '4mp'\n\t| '6mp'\n\t| '8mp'\n\t| '10mp'\n\t| '12mp'\n\t| '15mp'\n\t| '20mp'\n\t| '40mp'\n\t| '70mp';\n\nexport type GoogleImagesDate = 'd' | 'w' | 'm' | 'y';\nexport type GoogleImagesType =\n\t| 'animated'\n\t| 'face'\n\t| 'clipart'\n\t| 'lineart'\n\t| 'photo';\n\nexport interface GoogleImagesOptions {\n\tsize?: GoogleImagesSize;\n\tdate?: GoogleImagesDate;\n\ttype?: GoogleImagesType;\n\texcludedWords?: string[];\n}\n\nexport function googleImagesUrl(\n\tinput: string,\n\toptions?: GoogleImagesOptions,\n\t// size?: GoogleImagesSize,\n\t// date?: GoogleImagesDate,\n\t// excludeWords?: string[],\n) {\n\toptions ??= {};\n\n\tconst base = new URL('http://www.google.com/search');\n\tlet params = new URLSearchParams();\n\tparams.append('udm', '2');\n\tparams.append('as_q', input);\n\tif (options.excludedWords && options.excludedWords.length) {\n\t\tparams.append('as_eq', options.excludedWords.join(' '));\n\t}\n\n\tlet tbsParams = [];\n\tif (options.size) {\n\t\tif (!['s', 'm', 'l'].includes(options.size)) {\n\t\t\ttbsParams.push('isz:lt');\n\t\t\ttbsParams.push(`islt:${options.size}`);\n\t\t} else {\n\t\t\ttbsParams.push(`isz:${options.size}`);\n\t\t}\n\t}\n\tif (options.date) {\n\t\ttbsParams.push(`qdr:${options.date}`);\n\t}\n\tif (options.type) {\n\t\ttbsParams.push(`itp:${options.type}`);\n\t}\n\n\tif (tbsParams.length > 0) {\n\t\tparams.append('tbs', tbsParams.join(','));\n\t}\n\n\tbase.search = params.toString();\n\treturn base.toString();\n}\n\nexport function googleImagesOpen(\n\tinput: string,\n\toptions?: GoogleImagesOptions,\n\t// size?: GoogleImagesSize,\n\t// date?: GoogleImagesDate,\n\t// excludeWords?: string[],\n) {\n\topen(googleImagesUrl(input, options));\n}\n\nexport interface GoogleImagesSearchContext extends GoogleImagesOptions {\n\tquery: string[];\n\t// excluded: string[];\n\t// size?: GoogleImagesSize;\n\t// date?: GoogleImagesDate;\n\t// type?: GoogleImagesType;\n}\n\nexport function googleImagesUrlAnalyzer(\n\tgImgUrl: string,\n): GoogleImagesSearchContext {\n\tconst url = new URL(gImgUrl);\n\tconst info: GoogleImagesSearchContext = {\n\t\tquery: [],\n\t\texcludedWords: [],\n\t};\n\tconst params = url.searchParams;\n\tif (!params.get('udm') || params.get('udm') !== '2') {\n\t\tthrow new Error('Not a Google Images search');\n\t}\n\tconst getKeywords = (paramName: string) =>\n\t\t(params.get(paramName) ?? '').split(' ').filter((v) => v);\n\tconst keywords = [\n\t\t...getKeywords('q'),\n\t\t...getKeywords('as_q'),\n\t\t...getKeywords('as_eq').map((v) => `-${v}`),\n\t];\n\n\t// Search keywords\n\tinfo.query = keywords.filter((v) => !v.startsWith('-'));\n\t// Excluded search keywords\n\tinfo.excludedWords = keywords\n\t\t.filter((v) => v.startsWith('-'))\n\t\t.map((v) => v.slice(1));\n\n\tconst tbs = params.get('tbs');\n\tif (tbs) {\n\t\tconst tbsInfo = Object.fromEntries(\n\t\t\ttbs.split(',').map((p) => p.split(':')),\n\t\t);\n\t\tif (tbsInfo.isz) {\n\t\t\tinfo.size =\n\t\t\t\ttbsInfo.isz === 'lt' && tbsInfo.islt\n\t\t\t\t\t? tbsInfo.islt\n\t\t\t\t\t: tbsInfo.isz;\n\t\t}\n\t\tif (tbsInfo.qdr) {\n\t\t\tinfo.date = tbsInfo.qdr;\n\t\t}\n\t\tif (tbsInfo.itp) {\n\t\t\tinfo.type = tbsInfo.itp;\n\t\t}\n\t}\n\treturn info;\n}\n\n// google translate\nexport function googleTranslateUrl(\n\tinput: string,\n\tlang = 'en',\n\tsource = 'auto',\n) {\n\treturn `https://translate.google.com/?sl=${source}&tl=${lang}&text=${encodeURIComponent(\n\t\tinput,\n\t)}&op=translate`;\n}\nexport function googleTranslateOpen(\n\tinput: string,\n\tlang?: string,\n\tsource?: string,\n) {\n\topen(googleTranslateUrl(input, lang, source));\n}\n\nexport function youtubeUrl(id: string, time?: number) {\n\tconst t = Math.floor(time || 0);\n\treturn `https://www.youtube.com/watch?v=${id}${t ? `&t=${t}s` : ''}`;\n}\nexport function youtubeOpen(id: string, time?: number) {\n\topen(youtubeUrl(id, time));\n}\n\nexport function youtubeSearchUrl(input: string) {\n\treturn `https://www.youtube.com/results?search_query=${encodeURIComponent(\n\t\tinput,\n\t)}`;\n}\nexport function youtubeSearchOpen(input: string) {\n\topen(youtubeSearchUrl(input));\n}\n\n/**\n * Japanese related\n */\n// jisho\nexport function jishoUrl(input: string) {\n\treturn `https://jisho.org/search/${encodeURIComponent(input)}`;\n}\nexport function jishoOpen(input: string) {\n\topen(jishoUrl(input));\n}\n\n// goo\nexport function gooUrl(input: string) {\n\t// return `https://dictionary.goo.ne.jp/word/${encodeURIComponent(word)}/`;\n\treturn `https://dictionary.goo.ne.jp/srch/all/${encodeURIComponent(\n\t\tinput,\n\t)}/m0u/`;\n}\nexport function gooOpen(input: string) {\n\topen(gooUrl(input));\n}\n\n// weblio\nexport function weblioUrl(input: string) {\n\treturn `https://www.weblio.jp/content/${encodeURIComponent(input)}`;\n}\nexport function weblioOpen(input: string) {\n\topen(weblioUrl(input));\n}\n\n// kotobank\nexport function kotobankUrl(input: string) {\n\treturn `https://kotobank.jp/word/${encodeURIComponent(input)}`;\n}\nexport function kotobankOpen(input: string) {\n\topen(kotobankUrl(input));\n}\n\n// Mdbg\ninterface MdbgOptions {\n\ttype: 'simplified' | 'traditional';\n}\n\nexport function mdbgUrl(input: string, options?: Partial<MdbgOptions>) {\n\tconst defaults: MdbgOptions = {type: 'traditional'};\n\toptions = Object.assign({}, defaults, options);\n\treturn `https://www.mdbg.net/chinese/dictionary?page=worddict&wdrst=${options.type === 'simplified' ? 0 : 1}&wdqb=${encodeURIComponent(\n\t\tinput,\n\t)}`;\n}\nexport function mdbgOpen(input: string, options?: Partial<MdbgOptions>) {\n\topen(mdbgUrl(input, options));\n}\n\nexport function lensHistoryUrl(input: string, local = false) {\n\tif (local) {\n\t\treturn `http://localhost:5177/#search=${input}`;\n\t}\n\treturn `https://vdegenne.github.io/japanese-lens-history/#search=${input}`;\n}\nexport function lensHistoryOpen(input: string, local = false) {\n\topen(lensHistoryUrl(input, local));\n}\n\n/**\n * You need the extension: https://chromewebstore.google.com/detail/chatgpt-hash/dammfmpccfehndicnhkmjjiipkhongfa\n */\nexport function chatGptUrl(question: string, voice = false) {\n\tif (!question) {\n\t\tthrow new Error(\"A question can't be empty.\");\n\t}\n\treturn `https://chatgpt.com/#chash=${encodeURIComponent(question)}${voice ? '&voice' : ''}`;\n}\n/**\n * You need the extension: https://chromewebstore.google.com/detail/chatgpt-hash/dammfmpccfehndicnhkmjjiipkhongfa\n */\nexport function chatGptOpen(question: string) {\n\topen(chatGptUrl(question));\n}\n\nexport function chatGptMediatorUrl(input: string) {\n\treturn `https://chatgpt-mediator.web.app/?q=${encodeURIComponent(input)}`;\n\treturn `https://vdegenne.github.io/chatgpt-mediator/?q=${encodeURIComponent(input)}`;\n}\nexport function chatGptMediatorOpen(input: string) {\n\topen(chatGptMediatorUrl(input));\n}\n\nexport function googleUrl(input: string): string {\n\treturn `https://www.google.com/search?q=${encodeURIComponent(input)}`;\n}\nexport function googleOpen(input: string) {\n\topen(googleUrl(input));\n}\n\nexport function lichessUrl(fen: string, color?: 'w' | 'b') {\n\treturn `https://lichess.org/analysis/${fen}${color ? `_${color}` : ''}?color=white`;\n}\n\nexport function openLichess(fen: string, color?: 'w' | 'b') {\n\topen(lichessUrl(fen, color));\n}\n\nexport function chesscomUrl(fen: string) {\n\treturn `https://www.chess.com/analysis?fen=${encodeURIComponent(fen)}`;\n}\nexport function chesscomOpen(fen: string) {\n\topen(fen);\n}\n\nexport function googleMapsUrl(location: string) {\n\treturn `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(location)}`;\n}\nexport function googleMapsOpen(location: string) {\n\topen(googleMapsUrl(location));\n}\n\nexport function lazyMapUrl(location: string, local = false) {\n\tif (local) {\n\t\treturn `http://localhost:45737/?q=${encodeURIComponent(location)}`;\n\t} else {\n\t\t// return `https://vdegenne.github.io/lazymap/?q=${encodeURIComponent(location)}`;\n\t\treturn `https://lazymap-9b73a.web.app/?q=${encodeURIComponent(location)}`;\n\t}\n}\n\nexport function lazyMapOpen(location: string, local = false) {\n\topen(lazyMapUrl(location, local));\n}\n\nexport function textSelectorUrl(text: string) {\n\treturn `https://vdegenne.github.io/text-selector/?input=${encodeURIComponent(text)}`;\n}\nexport function textSelectorOpen(text: string) {\n\topen(textSelectorUrl(text));\n}\n\nexport function cropWithGamepadUrl() {\n\treturn `https://vdegenne.github.io/crop-with-gamepad/`;\n}\nexport function cropWithGamepadOpen() {\n\topen(cropWithGamepadUrl());\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,SAAS,IAAI,CAA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CAAC,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AAC9I,CAAC;AACD,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,OAA0B;IACxE,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,kBAAkB;IACjC,OAAO,+CAA+C,CAAC;AACxD,CAAC;AACD,MAAM,UAAU,mBAAmB;IAClC,IAAI,CAAC,kBAAkB,EAAE,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,IAAY;IACpC,OAAO,mCAAmC,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC;AACtE,CAAC;AACD,MAAM,UAAU,SAAS,CAAC,IAAY;IACrC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AACtB,CAAC","sourcesContent":["/**\n * @license\n * Copyright (c) 2023 Valentin Degenne\n * SPDX-License-Identifier: MIT\n */\n\nfunction open(url: string, newTab = true) {\n\tif (newTab) {\n\t\twindow.open(url, '_blank');\n\t} else {\n\t\twindow.open(url);\n\t}\n}\n\n/**\n * Google related links\n */\n// google images\nexport type GoogleImagesSize =\n\t| 'l'\n\t| 'm'\n\t| 'i'\n\t| 'qsvga'\n\t| 'vga'\n\t| 'svga'\n\t| 'xga'\n\t| '2mp'\n\t| '4mp'\n\t| '6mp'\n\t| '8mp'\n\t| '10mp'\n\t| '12mp'\n\t| '15mp'\n\t| '20mp'\n\t| '40mp'\n\t| '70mp';\n\nexport type GoogleImagesDate = 'd' | 'w' | 'm' | 'y';\nexport type GoogleImagesType =\n\t| 'animated'\n\t| 'face'\n\t| 'clipart'\n\t| 'lineart'\n\t| 'photo';\n\nexport interface GoogleImagesOptions {\n\tsize?: GoogleImagesSize;\n\tdate?: GoogleImagesDate;\n\ttype?: GoogleImagesType;\n\texcludedWords?: string[];\n}\n\nexport function googleImagesUrl(\n\tinput: string,\n\toptions?: GoogleImagesOptions,\n\t// size?: GoogleImagesSize,\n\t// date?: GoogleImagesDate,\n\t// excludeWords?: string[],\n) {\n\toptions ??= {};\n\n\tconst base = new URL('http://www.google.com/search');\n\tlet params = new URLSearchParams();\n\tparams.append('udm', '2');\n\tparams.append('as_q', input);\n\tif (options.excludedWords && options.excludedWords.length) {\n\t\tparams.append('as_eq', options.excludedWords.join(' '));\n\t}\n\n\tlet tbsParams = [];\n\tif (options.size) {\n\t\tif (!['s', 'm', 'l'].includes(options.size)) {\n\t\t\ttbsParams.push('isz:lt');\n\t\t\ttbsParams.push(`islt:${options.size}`);\n\t\t} else {\n\t\t\ttbsParams.push(`isz:${options.size}`);\n\t\t}\n\t}\n\tif (options.date) {\n\t\ttbsParams.push(`qdr:${options.date}`);\n\t}\n\tif (options.type) {\n\t\ttbsParams.push(`itp:${options.type}`);\n\t}\n\n\tif (tbsParams.length > 0) {\n\t\tparams.append('tbs', tbsParams.join(','));\n\t}\n\n\tbase.search = params.toString();\n\treturn base.toString();\n}\n\nexport function googleImagesOpen(\n\tinput: string,\n\toptions?: GoogleImagesOptions,\n\t// size?: GoogleImagesSize,\n\t// date?: GoogleImagesDate,\n\t// excludeWords?: string[],\n) {\n\topen(googleImagesUrl(input, options));\n}\n\nexport interface GoogleImagesSearchContext extends GoogleImagesOptions {\n\tquery: string[];\n\t// excluded: string[];\n\t// size?: GoogleImagesSize;\n\t// date?: GoogleImagesDate;\n\t// type?: GoogleImagesType;\n}\n\nexport function googleImagesUrlAnalyzer(\n\tgImgUrl: string,\n): GoogleImagesSearchContext {\n\tconst url = new URL(gImgUrl);\n\tconst info: GoogleImagesSearchContext = {\n\t\tquery: [],\n\t\texcludedWords: [],\n\t};\n\tconst params = url.searchParams;\n\tif (!params.get('udm') || params.get('udm') !== '2') {\n\t\tthrow new Error('Not a Google Images search');\n\t}\n\tconst getKeywords = (paramName: string) =>\n\t\t(params.get(paramName) ?? '').split(' ').filter((v) => v);\n\tconst keywords = [\n\t\t...getKeywords('q'),\n\t\t...getKeywords('as_q'),\n\t\t...getKeywords('as_eq').map((v) => `-${v}`),\n\t];\n\n\t// Search keywords\n\tinfo.query = keywords.filter((v) => !v.startsWith('-'));\n\t// Excluded search keywords\n\tinfo.excludedWords = keywords\n\t\t.filter((v) => v.startsWith('-'))\n\t\t.map((v) => v.slice(1));\n\n\tconst tbs = params.get('tbs');\n\tif (tbs) {\n\t\tconst tbsInfo = Object.fromEntries(\n\t\t\ttbs.split(',').map((p) => p.split(':')),\n\t\t);\n\t\tif (tbsInfo.isz) {\n\t\t\tinfo.size =\n\t\t\t\ttbsInfo.isz === 'lt' && tbsInfo.islt\n\t\t\t\t\t? tbsInfo.islt\n\t\t\t\t\t: tbsInfo.isz;\n\t\t}\n\t\tif (tbsInfo.qdr) {\n\t\t\tinfo.date = tbsInfo.qdr;\n\t\t}\n\t\tif (tbsInfo.itp) {\n\t\t\tinfo.type = tbsInfo.itp;\n\t\t}\n\t}\n\treturn info;\n}\n\n// google translate\nexport function googleTranslateUrl(\n\tinput: string,\n\tlang = 'en',\n\tsource = 'auto',\n) {\n\treturn `https://translate.google.com/?sl=${source}&tl=${lang}&text=${encodeURIComponent(\n\t\tinput,\n\t)}&op=translate`;\n}\nexport function googleTranslateOpen(\n\tinput: string,\n\tlang?: string,\n\tsource?: string,\n) {\n\topen(googleTranslateUrl(input, lang, source));\n}\n\nexport function youtubeUrl(id: string, time?: number) {\n\tconst t = Math.floor(time || 0);\n\treturn `https://www.youtube.com/watch?v=${id}${t ? `&t=${t}s` : ''}`;\n}\nexport function youtubeOpen(id: string, time?: number) {\n\topen(youtubeUrl(id, time));\n}\n\nexport function youtubeSearchUrl(input: string) {\n\treturn `https://www.youtube.com/results?search_query=${encodeURIComponent(\n\t\tinput,\n\t)}`;\n}\nexport function youtubeSearchOpen(input: string) {\n\topen(youtubeSearchUrl(input));\n}\n\n/**\n * Japanese related\n */\n// jisho\nexport function jishoUrl(input: string) {\n\treturn `https://jisho.org/search/${encodeURIComponent(input)}`;\n}\nexport function jishoOpen(input: string) {\n\topen(jishoUrl(input));\n}\n\n// goo\nexport function gooUrl(input: string) {\n\t// return `https://dictionary.goo.ne.jp/word/${encodeURIComponent(word)}/`;\n\treturn `https://dictionary.goo.ne.jp/srch/all/${encodeURIComponent(\n\t\tinput,\n\t)}/m0u/`;\n}\nexport function gooOpen(input: string) {\n\topen(gooUrl(input));\n}\n\n// weblio\nexport function weblioUrl(input: string) {\n\treturn `https://www.weblio.jp/content/${encodeURIComponent(input)}`;\n}\nexport function weblioOpen(input: string) {\n\topen(weblioUrl(input));\n}\n\n// kotobank\nexport function kotobankUrl(input: string) {\n\treturn `https://kotobank.jp/word/${encodeURIComponent(input)}`;\n}\nexport function kotobankOpen(input: string) {\n\topen(kotobankUrl(input));\n}\n\n// Mdbg\ninterface MdbgOptions {\n\ttype: 'simplified' | 'traditional';\n}\n\nexport function mdbgUrl(input: string, options?: Partial<MdbgOptions>) {\n\tconst defaults: MdbgOptions = {type: 'traditional'};\n\toptions = Object.assign({}, defaults, options);\n\treturn `https://www.mdbg.net/chinese/dictionary?page=worddict&wdrst=${options.type === 'simplified' ? 0 : 1}&wdqb=${encodeURIComponent(\n\t\tinput,\n\t)}`;\n}\nexport function mdbgOpen(input: string, options?: Partial<MdbgOptions>) {\n\topen(mdbgUrl(input, options));\n}\n\nexport function lensHistoryUrl(input: string, local = false) {\n\tif (local) {\n\t\treturn `http://localhost:5177/#search=${input}`;\n\t}\n\treturn `https://vdegenne.github.io/japanese-lens-history/#search=${input}`;\n}\nexport function lensHistoryOpen(input: string, local = false) {\n\topen(lensHistoryUrl(input, local));\n}\n\n/**\n * You need the extension: https://chromewebstore.google.com/detail/chatgpt-hash/dammfmpccfehndicnhkmjjiipkhongfa\n */\nexport function chatGptUrl(question: string, voice = false) {\n\tif (!question) {\n\t\tthrow new Error(\"A question can't be empty.\");\n\t}\n\treturn `https://chatgpt.com/#chash=${encodeURIComponent(question)}${voice ? '&voice' : ''}`;\n}\n/**\n * You need the extension: https://chromewebstore.google.com/detail/chatgpt-hash/dammfmpccfehndicnhkmjjiipkhongfa\n */\nexport function chatGptOpen(question: string) {\n\topen(chatGptUrl(question));\n}\n\nexport function chatGptMediatorUrl(question: string) {\n\treturn `https://chatgpt-mediator.web.app/?q=${encodeURIComponent(question)}`;\n\treturn `https://vdegenne.github.io/chatgpt-mediator/?q=${encodeURIComponent(question)}`;\n}\nexport function chatGptMediatorOpen(input: string) {\n\topen(chatGptMediatorUrl(input));\n}\n\nexport function googleUrl(input: string): string {\n\treturn `https://www.google.com/search?q=${encodeURIComponent(input)}`;\n}\nexport function googleOpen(input: string) {\n\topen(googleUrl(input));\n}\n\nexport function lichessUrl(fen: string, color?: 'w' | 'b') {\n\treturn `https://lichess.org/analysis/${fen}${color ? `_${color}` : ''}?color=white`;\n}\n\nexport function openLichess(fen: string, color?: 'w' | 'b') {\n\topen(lichessUrl(fen, color));\n}\n\nexport function chesscomUrl(fen: string) {\n\treturn `https://www.chess.com/analysis?fen=${encodeURIComponent(fen)}`;\n}\nexport function chesscomOpen(fen: string) {\n\topen(fen);\n}\n\nexport function googleMapsUrl(location: string) {\n\treturn `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(location)}`;\n}\nexport function googleMapsOpen(location: string) {\n\topen(googleMapsUrl(location));\n}\n\nexport function lazyMapUrl(location: string, local = false) {\n\tif (local) {\n\t\treturn `http://localhost:45737/?q=${encodeURIComponent(location)}`;\n\t} else {\n\t\t// return `https://vdegenne.github.io/lazymap/?q=${encodeURIComponent(location)}`;\n\t\treturn `https://lazymap-9b73a.web.app/?q=${encodeURIComponent(location)}`;\n\t}\n}\n\nexport function lazyMapOpen(location: string, local = false) {\n\topen(lazyMapUrl(location, local));\n}\n\nexport function textSelectorUrl(text: string, options?: {search: string}) {\n\treturn `https://vdegenne.github.io/text-selector/?input=${encodeURIComponent(text)}${options && options.search ? `#${options.search}` : ''}`;\n}\nexport function textSelectorOpen(text: string, options?: {search: string}) {\n\topen(textSelectorUrl(text, options));\n}\n\nexport function cropWithGamepadUrl() {\n\treturn `https://vdegenne.github.io/crop-with-gamepad/`;\n}\nexport function cropWithGamepadOpen() {\n\topen(cropWithGamepadUrl());\n}\n\nexport function cnrtlUrl(word: string) {\n\treturn `https://www.cnrtl.fr/definition/${encodeURIComponent(word)}`;\n}\nexport function cnrtlOpen(word: string) {\n\topen(cnrtlUrl(word));\n}\n"]}
|