Giter VIP home page Giter VIP logo

ddg's Introduction

ddg

Duck Duck Go zero-click api for your command-line

Install

$ pip install ddg

or from the source: :

$ python setup.py install

Usage

ddg [-h] [-b] [-d] [-j] [-l] [-s] [-u] [query [query ...]]

www.duckduckgo.com zero-click api for your command-line

positional arguments:

query the search query

optional arguments:

-h, --help show this help message and exit -b, --bang open the !bang redirect url in a new browser tab -d, --define return the definition result -j, --json return the zero-click info api json response -l, --lucky open the result url in a new browser tab -s, --search launch a DuckDuckGo search in a new browser tab -u, --url return the result url

Examples

Call ddg from your command line to access the Duck Duck Go Zero-Click Info API :

$ddg red-black tree
A red–black tree is a type of self-balancing binary search tree, a data structure 
used in computer science, typically used to implement associative arrays.

Get the url of the answer source :

$ ddg red-black tree -u
https://en.wikipedia.org/wiki/Red-black_tree

Combinining flags behaves as expected :

$ ddg schnauzer -d -u
http://www.merriam-webster.com/dictionary/schnauzer

Launch a !Bang redirect in your web browser with the -b flag

Launch a query on Wolfram Alpha :

$ ddg wa integral of sin x / x from negative inf to inf -b

Launch a search on Stack Overflow :

$ ddg so [c++11] lambda return values -b

Launch a search on Duck Duck Go with -s :

$ ddg Lord of the Rings -s

Launch the result url directly with -l :

$ ddg python webbrowser -l

ddg plays nice with other utilities in your shell :

$ echo "shark" | ddg -dl
$ ddg welsh corgi -u | pbcopy
$ ls | ddg -du

Use -j to output the json response from the API :

$ ddg simpsons characters -j >> file.txt

Thanks

The duckduckgo module is a modification from http://github.com/crazedpsyc/python-duckduckgo.
Original duckduckgo module source from http://github.com/mikejs/python-duckduckgo (outdated)

ddg's People

Contributors

jshrake avatar sigmavirus24 avatar justinls avatar invl avatar

Stargazers

Gianluca Fiore avatar Adrian Lucrèce Céleste avatar

Watchers

Gianluca Fiore avatar James Cloos avatar Casey Mulcahy avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.