mirror of
https://github.com/friendica/friendica
synced 2025-04-26 01:10:15 +00:00
Improvements how gcontact entries are updated
This commit is contained in:
parent
036311237f
commit
2ca6cdf6b6
7 changed files with 133 additions and 214 deletions
|
@ -12,6 +12,18 @@ function scrape_dfrn($url, $dont_probe = false) {
|
|||
|
||||
logger('scrape_dfrn: url=' . $url);
|
||||
|
||||
// Try to fetch the data from noscrape. This is faster than parsing the HTML
|
||||
$noscrape = str_replace("/hcard/", "/noscrape/", $url);
|
||||
$noscrapejson = fetch_url($noscrape);
|
||||
$noscrapedata = array();
|
||||
if ($noscrapejson) {
|
||||
$noscrapedata = json_decode($noscrapejson, true);
|
||||
|
||||
if (is_array($noscrapedata))
|
||||
if ($noscrapedata["nick"] != "")
|
||||
return($noscrapedata);
|
||||
}
|
||||
|
||||
$s = fetch_url($url);
|
||||
|
||||
if(! $s)
|
||||
|
@ -91,8 +103,7 @@ function scrape_dfrn($url, $dont_probe = false) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $ret;
|
||||
return array_merge($ret, $noscrapedata);
|
||||
}}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue