mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-01 14:24:39 +03:00
[GoogleSearch] feat: add verbatim option (#2858)
The verbatim option is the same as wrapping the query in quotes e.g. "rss-bridge".
This commit is contained in:
parent
1cfcacbbeb
commit
92782e6c34
1 changed files with 8 additions and 2 deletions
|
@ -13,7 +13,12 @@ class GoogleSearchBridge extends BridgeAbstract {
|
||||||
'name' => 'keyword',
|
'name' => 'keyword',
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'exampleValue' => 'rss-bridge',
|
'exampleValue' => 'rss-bridge',
|
||||||
)
|
),
|
||||||
|
'verbatim' => array(
|
||||||
|
'name' => 'Verbatim',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'title' => 'Use literal keyword(s) without making improvements',
|
||||||
|
),
|
||||||
));
|
));
|
||||||
|
|
||||||
public function collectData(){
|
public function collectData(){
|
||||||
|
@ -78,7 +83,8 @@ class GoogleSearchBridge extends BridgeAbstract {
|
||||||
'hl' => 'en',
|
'hl' => 'en',
|
||||||
'num' => '100', // get 100 results
|
'num' => '100', // get 100 results
|
||||||
'complete' => '0',
|
'complete' => '0',
|
||||||
'tbs' => 'qdr:y,sbd:1' // in past year, sort by date
|
// in past year, sort by date, optionally verbatim
|
||||||
|
'tbs' => 'qdr:y,sbd:1' . ($this->getInput('verbatim') ? ',li:1' : ''),
|
||||||
];
|
];
|
||||||
return sprintf('https://www.google.com/search?%s', http_build_query($queryParameters));
|
return sprintf('https://www.google.com/search?%s', http_build_query($queryParameters));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue