aboutsummaryrefslogtreecommitdiff
path: root/bridges/DuckDuckGoBridge.php
blob: eca63275c6c9842d1a94225c7daaf7c539b4af88 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
class DuckDuckGoBridge extends BridgeAbstract{

	public function loadMetadatas() {

		$this->maintainer = "Astalaseven";
		$this->name = "DuckDuckGo";
		$this->uri = "https://duckduckgo.com/";
		$this->description = "Returns most recent results from DuckDuckGo.";
		$this->update = "2014-05-25";

		$this->parameters[] =
		'[
			{
				"name" : "keyword",
				"identifier" : "u"
			}
		]';
	}

    public function collectData(array $param){
        $html = '';
        $link = 'http://duckduckgo.com/html/?q='.$param[u].'+sort:date';

        $html = $this->file_get_html($link) or $this->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
    }
}
arred/upgrade-zig-2 Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/src/javascript/jsc/bindings/webcore/JSCanvasTextAlign.cpp (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2022-04-03wipGravatar Jarred Sumner 1-0/+76
2022-04-03[bun.js] Expose `ImageData` globallyGravatar Jarred Sumner 12-2/+1237
2022-04-02More typesGravatar Jarred Sumner 2-39/+3998
2022-04-02Add more typingsGravatar Jarred Sumner 1-2/+416
2022-04-02Add more tests for Node FSGravatar Jarred Sumner 4-1/+60
2022-04-02[bun.js] fs.readSync & fs.writeSync should return just the numberGravatar Jarred Sumner 1-24/+57
2022-04-02[bun.js] Support `mode` and `flags` as integer args in fs.openSync (instead o...Gravatar Jarred Sumner 1-0/+6
2022-04-02Update base.zigGravatar Jarred Sumner 1-0/+1
2022-04-02Fix GC bug when reading TypedArray from user inputGravatar Jarred Sumner 1-6/+36
2022-04-02s/Buffer/TypedArrayGravatar Jarred Sumner 1-17/+17
2022-04-02Fix mmap on macOS x64Gravatar Jarred Sumner 2-29/+27