Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

first release #1

Merged
merged 1 commit into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[package]
name = "duckduckgo"
version = "0.1.0"
authors = ["Mahmoud Harmouch <oss@wiseai.dev>"]
edition = "2021"
description = "🦆 A CLI and library for colorful DuckDuckGo searches."
license = "MIT"
homepage = "https://github.com/wiseaidev/duckduckgo"
documentation = "https://docs.rs/duckduckgo"
repository = "https://github.com/wiseaidev/duckduckgo"
categories = ["command-line-interface", "command-line-utilities"]
keywords = ["cli", "duckduckgo", "search", "dorks", "api"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
clap = { version = "4.4.11", features = ["derive"] }
reqwest = { version="0.11.23", features=["cookies",] }
serde = { version = "1.0.193", features = ["derive"] }
serde_json = "1.0.108"
tokio = { version = "1.35.1", features = ["full"] }
urlencoding = "2.1.3"

[profile.release]
codegen-units = 1
opt-level = "z"
lto = "thin"
strip = "symbols"
121 changes: 121 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# 🦆 DuckDuckGo

[![Crates.io](https://img.shields.io/crates/v/duckduckgo.svg)](https://crates.io/crates/duckduckgo)
[![docs](https://docs.rs/duckduckgo/badge.svg)](https://docs.rs/duckduckgo/)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

```sh
duckduckgo 0.1.0

▓█████▄ █ ██ ▄████▄ ██ ▄█▀▓█████▄ █ ██ ▄████▄ ██ ▄█▀ ▄████ ▒█████
▒██▀ ██▌ ██ ▓██▒▒██▀ ▀█ ██▄█▒ ▒██▀ ██▌ ██ ▓██▒▒██▀ ▀█ ██▄█▒ ██▒ ▀█▒▒██▒ ██▒
░██ █▌▓██ ▒██░▒▓█ ▄ ▓███▄░ ░██ █▌▓██ ▒██░▒▓█ ▄ ▓███▄░ ▒██░▄▄▄░▒██░ ██▒
░▓█▄ ▌▓▓█ ░██░▒▓▓▄ ▄██▒▓██ █▄ ░▓█▄ ▌▓▓█ ░██░▒▓▓▄ ▄██▒▓██ █▄ ░▓█ ██▓▒██ ██░
░▒████▓ ▒▒█████▓ ▒ ▓███▀ ░▒██▒ █▄░▒████▓ ▒▒█████▓ ▒ ▓███▀ ░▒██▒ █▄░▒▓███▀▒░ ████▓▒░
▒▒▓ ▒ ░▒▓▒ ▒ ▒ ░ ░▒ ▒ ░▒ ▒▒ ▓▒ ▒▒▓ ▒ ░▒▓▒ ▒ ▒ ░ ░▒ ▒ ░▒ ▒▒ ▓▒ ░▒ ▒ ░ ▒░▒░▒░
░ ▒ ▒ ░░▒░ ░ ░ ░ ▒ ░ ░▒ ▒░ ░ ▒ ▒ ░░▒░ ░ ░ ░ ▒ ░ ░▒ ▒░ ░ ░ ░ ▒ ▒░
░ ░ ░ ░░░ ░ ░ ░ ░ ░░ ░ ░ ░ ░ ░░░ ░ ░ ░ ░ ░░ ░ ░ ░ ░ ░ ░ ░ ▒
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
░ ░ ░ ░
Search and advanced search in DuckDuckGo
========================================

Perform searches and advanced searches on DuckDuckGo from the command line.
```

> 🚀 **duckduckgo**: A powerful Rust-based command-line tool for seamless DuckDuckGo searches.

## 📖 Table of Contents

- [Installation](#-installation)
- [Feature](#-feature)
- [Usage](#-usage)
- [Options](#-options)
- [Contributing](#-contributing)
- [License](#-license)

## 🚀 Installation

To install `duckduckgo`, use the following Cargo command:

```bash
cargo install --locked duckduckgo
```

## 🚀 Features

- Perform DuckDuckGo searches with or without operators.
- Customizable user agent, proxy, and cookie support.
- Beautiful ANSI-colored output.

## 🚗 Usage

Learn how to use the duckduckgo and explore its features with the following examples:

### Perform a basic search:

```bash
duckduckgo --query "rust lang"
```

### Use search operators:

```bash
duckduckgo --query "rust lang" --operators "+tutorial"
```

### Enable safe search:

```bash
duckduckgo --query "rust lang" --safe
```

### Set the output format to detailed:

```bash
duckduckgo --query "rust lang" --format
```

### Limit the number of results to 3:

```bash
duckduckgo --query "rust lang" --limit 3
```

### Set user agent:

```bash
duckduckgo --query "rust lang" --user-agent "MyCustomAgent"
```

### Set cookie for subsequent requests:

```bash
duckduckgo --query "rust lang" --cookie
```

### Set proxy:

```bash
duckduckgo --query "rust lang" --proxy "socks5://192.168.1.1:9000"
```

## 🎨 Options

| Option | Default Value | Description |
|--------------------------|---------------|----------------------------------------------------------|
| `--safe` | `false` | Enable safe search. |
| `--proxy` | `""` | Set a proxy for the search (e.g., "socks5://192.168.1.1:9000"). |
| `--user-agent` | `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3` | Set a custom user agent for the search. |
| `--cookie` | `true` | Set a cookie for the search. |
| `--format` | `false` | Set the output format (`false` for list or `true` for detailed). |
| `--limit` | `10` | Limit the number of results (default is 10). |

## 🤝 Contributing

Contributions and feedback are welcome! If you'd like to contribute, report an issue, or suggest an enhancement, please engage with the project on [GitHub](https://github.com/wiseaidev/duckduckgo).
Your contributions help improve this CLI for the community.

## 📄 License

This project is licensed under the [MIT License](LICENSE).
Loading