Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nsubiron/duckduckgo2html
Python 3 library to retrieve results from the DuckDuckGo zero-click API in simple HTML format.
https://github.com/nsubiron/duckduckgo2html
Last synced: 23 days ago
JSON representation
Python 3 library to retrieve results from the DuckDuckGo zero-click API in simple HTML format.
- Host: GitHub
- URL: https://github.com/nsubiron/duckduckgo2html
- Owner: nsubiron
- License: other
- Created: 2015-02-28T14:57:39.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-20T19:17:29.000Z (over 7 years ago)
- Last Synced: 2023-06-18T01:40:16.607Z (over 1 year ago)
- Language: Python
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
duckduckgo2html
===============Python 3 library to retrieve results from the
[DuckDuckGo zero-click API](https://api.duckduckgo.com) in simple HTML format.Use examples
------------###### Retrieving html from a query result
```python
import duckduckgo2htmlresults = duckduckgo2html.search("DuckDuckGo")
html = duckduckgo2html.results2html(results)
``````html
Abstract
DuckDuckGo - DuckDuckGo is an Internet search engine that emphasizes protecting searchers' privacy and avoiding the filter bubble of personalized search results. DuckDuckGo distinguishes itself from other search engines by not profiling its users and by deliberately showing all users the same search results for a given search term. DuckDuckGo emphasizes returning the best results, rather than the most results, and generates those results from over 400 individual sources, including key crowdsourced sites such as Wikipedia, and other search engines like Bing, Yahoo!, Yandex, and Yummly. - Wikipedia
Results
Infobox
Type of site Web search engine
Owner Duck Duck Go, Inc.
Created by Gabriel Weinberg
Launched September 25, 2008
Alexa rank 468 (June 10, 2017)
Results from DuckDuckGo
```###### Striping out just the answer
```python
duckduckgo2html.results2html(
duckduckgo2html.search("sunrise"),
section_priority=["answer"],
hide_headers=True,
hide_footer=True))
``````html
On 16 Jun 2017, sunrise in Barcelona, Catalonia is at 6:17 AM; sunset at 9:27 PM
```###### Command-line usage
```
$ ./duckduckgo2html.py --pretty-print query
```API
---```python
duckduckgo2html.results2html(
results, # Results of a query.
section_priority=None, # List of section names to be displayed in the given order
max_number_of_sections=None, # Maximum number of sections to be displayed
ignore_incomplete=True, # Ignore incomplete sections
always_show_related=False, # Always show "Related topics" section
header_start_level=1, # Level to start the html header hierarchy
hide_headers=False, # Hide html headers
hide_footer=False) # Hide "Results from DuckDuckGo" footer
```Default section names priority: answer, abstract, definition, results, infobox,
redirect, related.Licence
-------`duckduckgo.py` is a modification (ported to Python 3) of the duckduckgo module
of [ddg](https://github.com/jshrake/ddg) by Justin Shrake.Which is a modification from http://github.com/crazedpsyc/python-duckduckgo.
Which is a modification of the original duckduckgo module from
http://github.com/mikejs/python-duckduckgo by Michael Stephens ,
released under a BSD-style license.