DuckDuckGo URL Collector

Collects all URLs from DuckDuckGo search results with logging and duplicate prevention

当前为 2025-01-29 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

作者
Ghosty-Tongue
评分
0 0 0
版本
1.1
创建于
2025-01-29
更新于
2025-01-29
大小
5.5 KB
许可证
MIT
适用于

DuckDuckGo URL Collector
A Tampermonkey/Greasemonkey script for comprehensive search result management

🔍 Description

This userscript automatically collects all unique URLs from DuckDuckGo search results, including those hidden behind pagination ("More Results"). Features include:

  • 🌈 RGB-animated collection button
  • ⏱️ Real-time duration timer
  • 🔄 Automatic pagination handling
  • 📋 Duplicate prevention
  • 📥 Automatic TXT file download
  • 📊 Progress logging/notifications
  • 🖥️ Visual feedback during processing

📥 Installation

  1. Install a userscript manager:

  2. Install the script

  3. Confirm installation in your userscript manager

🚀 Usage Guide

  1. Navigate to DuckDuckGo
  2. Perform any search
  3. Look for the animated 🦆 button (top-right corner)
  4. Click the button to start collection
  5. Wait while the script:
    • Automatically loads all results (clicking "More Results")
    • Collects unique URLs
    • Shows progress in console
  6. Automatic download (urls.txt) when complete

⚙️ Technical Features

  • Smart Detection: Uses DOM queries ([data-testid="result"])
  • Efficient Storage: Set object for O(1) lookups
  • Visual Feedback:
    • Button animation during processing
    • Desktop notifications
    • Console logging (F12 to view)
  • File Handling: Creates Blob URLs for instant download
  • Performance: 2-second delays between page loads

⚠️ Limitations

  1. Only works on DuckDuckGo search results pages
  2. Dependent on DuckDuckGo's DOM structure
  3. Requires JavaScript enabled
  4. May not work with some privacy extensions
  5. Limited to ~1000 results (DuckDuckGo's pagination limit)

🔧 Troubleshooting

Problem: Button not appearing
✅ Solutions:

  • Refresh page after script installation
  • Check userscript manager is enabled
  • Verify script matches *://duckduckgo.com/*

Problem: Partial results collection
✅ Solutions:

  • Wait for script completion (notification appears)
  • Check console for errors (F12 > Console)
  • Disable conflicting extensions

Problem: File not downloading
✅ Solutions:

  • Check browser download permissions
  • Disable popup blockers
  • Allow multiple downloads in browser settings

🛠️ Customization (Advanced)

Modify these values in the script:

// Change delay between page loads (ms)
await new Promise(resolve => setTimeout(resolve, 2000)); 

// Modify filename
a.download = 'urls.txt';

// Change button styling
Object.assign(btn.style, { ... });

📜 License

MIT Licensed - Feel free to modify/redistribute but please:

  • Maintain author credit
  • Link to original source
  • Share improvements with community