diff options
Diffstat (limited to 'modules/core/module-duckduckgo.js')
| -rw-r--r-- | modules/core/module-duckduckgo.js | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/modules/core/module-duckduckgo.js b/modules/core/module-duckduckgo.js deleted file mode 100644 index c443b72..0000000 --- a/modules/core/module-duckduckgo.js +++ /dev/null @@ -1,38 +0,0 @@ -// Extracted from newOS4 index.html — DuckDuckGoModule - class DuckDuckGoModule { - constructor() { - this.commands = {}; - this.terminal = null; - } - getHelpInfo() { - return { - 'ddg': 'ddg <query> — Search DuckDuckGo (opens query in new tab)', - 'duck': 'duck <query> — Alias for ddg', - }; - } - registerCommands() { - this.commands['ddg'] = (args) => this.search(args); - this.commands['duck'] = (args) => this.search(args); - } - async search(args) { - if (!args[0]) { - this.terminal.print("Usage: ddg <search-query>", "warning"); - this.terminal.print("Example: ddg javascript tutorials", "info"); - this.terminal.print("Note: Due to CORS, results may be limited. Try 'search' command for better results.", "warning"); - return; - } - const query = args.join(' '); - this.terminal.print(`🦆 DuckDuckGo Search: ${query}`, "info"); - - // DuckDuckGo doesn't have a public API, so we provide alternatives - this.terminal.print("⚠️ DuckDuckGo doesn't provide a public API for direct access.", "warning"); - this.terminal.print("Opening search in new tab...", "info"); - - // Open in new tab as fallback - const ddgUrl = `https://duckduckgo.com/?q=${encodeURIComponent(query)}`; - window.open(ddgUrl, '_blank'); - - this.terminal.print(`\n💡 Alternative: Use 'search <query>' for SearXNG (privacy-focused)`, "info"); - this.terminal.print(`🔗 Direct link: ${ddgUrl}`, "info"); - } - } |