diff --git a/bridges/DuckDuckGoBridge.php b/bridges/DuckDuckGoBridge.php new file mode 100644 index 00000000..a194a5c7 --- /dev/null +++ b/bridges/DuckDuckGoBridge.php @@ -0,0 +1,39 @@ +returnError('Could not request DuckDuckGo.', 404); + + foreach($html->find('div.results_links') as $element) { + $item = new \Item(); + $item->uri = $element->find('a', 0)->href; + $item->title = $element->find('a', 1)->innertext; + $item->content = $element->find('div.snippet', 0)->plaintext; + $this->items[] = $item; + } + } + + public function getName(){ + return 'DuckDuckGo'; + } + + public function getURI(){ + return 'https://duckduckgo.com'; + } + + public function getCacheDuration(){ + return 21600; // 6 hours + } +}