1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-06 00:27:27 +02:00

[GoogleSearch] Correct parsing uri of search result (#1601)

This commit is contained in:
Eugene Molotov
2020-07-27 11:44:07 +05:00
committed by GitHub
parent 78facbcb83
commit a33088ca99

View File

@@ -35,14 +35,8 @@ class GoogleSearchBridge extends BridgeAbstract {
$item = array();
// Extract direct URL from google href (eg. /url?q=...)
$t = $element->find('a[href]', 0)->href;
$item['uri'] = '' . $t;
parse_str(parse_url($t, PHP_URL_QUERY), $parameters);
if(isset($parameters['q'])) {
$item['uri'] = $parameters['q'];
}
$item['uri'] = htmlspecialchars_decode($t);
$item['title'] = $element->find('h3', 0)->plaintext;
$item['content'] = $element->find('span[class=st]', 0)->plaintext;