README.rst 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. Ducker
  2. ======
  3. What the duck is Ducker?
  4. ------------------------
  5. Ducker is a lightweight program that makes internet searches with DuckDuckGo
  6. from the command line. It can display the search results in your terminal or
  7. directly in DuckDuckGo's website with your browser.
  8. Usage
  9. -----
  10. Just execute it in your shell with keywords you want to use. The following
  11. example searchs for classical music by opening the search results in your
  12. default browser.
  13. .. code-block:: bash
  14. $ duck classical music
  15. There are options to search specifically for images, videos or websites.
  16. There is also an interactive mode, which lets you make use of more advanced
  17. options. Open the interactive mode by calling Ducker without arguments.
  18. When you make a search in the interactive mode, the search results
  19. are displayed in your terminal. Each result consist of a number, a title,
  20. a URL and an abstract. After making the search you can open the URL of the
  21. first result by entering `1`. Your default browser will open that URL
  22. (opening a new tab if it's already running) and the program will prompt you
  23. again until you decide to exit. You can quit the program entering `q`.
  24. To check out every option execute the program with the
  25. `--help` or `-h` arguments.
  26. Installation
  27. ------------
  28. You don't have to install Ducker to run it. Just install Python 3.3 or later
  29. (if you don't have it installed) and execute the `run_ducker.py` file.
  30. However, you can install Ducker if you want with pip:
  31. .. code-block:: bash
  32. $ pip install ducker
  33. Customization
  34. -------------
  35. You can always use your favourite command-line options of Ducker using Bash
  36. aliases or other utilities available for your shell. Let's say we want to
  37. add an option to search for articles in Wikipedia; we could create a Bash
  38. alias for that.
  39. .. code-block:: bash
  40. $ alias wikipedia='ducker \!w'
  41. Calling ``wikipedia`` in the shell would open the main page of wikipedia, and
  42. calling ``wikipedia free software`` would open the `"Free software" article
  43. from wikipedia`_. Note that we're using `DuckDuckGo bangs`_ and that the
  44. exclamation mark (!) must be escaped in Bash.
  45. Similarly, you can create an alias to never use JavaScript when using Ducker.
  46. .. code-block:: bash
  47. $ alias duck='ducker --no-javascript'
  48. Related projects
  49. ----------------
  50. - `ddgr`_: Power tool to use DuckDuckGo from the command-line.
  51. - `DuckDuckGo`_: Search engine which doesn't track its users.
  52. - `googler`_: Power tool to Google (Web & News) and Google Site Search from the command-line.
  53. .. _DuckDuckGo bangs: https://duckduckgo.com/bang
  54. .. _"Free software" article from wikipedia: https://en.wikipedia.org/wiki/Free_software
  55. .. _ddgr: https://github.com/jarun/ddgr/
  56. .. _DuckDuckGo: https://duckduckgo.com/
  57. .. _googler: https://github.com/jarun/googler/