diff options
author | zottel <github@zottel.net> | 2012-05-02 08:11:52 +0200 |
---|---|---|
committer | zottel <github@zottel.net> | 2012-05-02 08:11:52 +0200 |
commit | 6000e7f30d1193dada903eaf0e6f44149a3dde33 (patch) | |
tree | 9b9f482f611b6dd91866518387b79140c6567be7 /include/gprobe.php | |
parent | 2e2bb5e8b0d2ab4a732cafd2ada30a76c4883177 (diff) | |
parent | becdb1f5085f2561b8b0acebbdbf43e4a81d50da (diff) | |
download | volse-hubzilla-6000e7f30d1193dada903eaf0e6f44149a3dde33.tar.gz volse-hubzilla-6000e7f30d1193dada903eaf0e6f44149a3dde33.tar.bz2 volse-hubzilla-6000e7f30d1193dada903eaf0e6f44149a3dde33.zip |
Merge remote branch 'upstream/master'
Diffstat (limited to 'include/gprobe.php')
-rw-r--r-- | include/gprobe.php | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/include/gprobe.php b/include/gprobe.php index 26254ad28..5ca42729a 100644 --- a/include/gprobe.php +++ b/include/gprobe.php @@ -2,6 +2,7 @@ require_once("boot.php"); require_once('include/Scrape.php'); +require_once('include/socgraph.php'); function gprobe_run($argv, $argc){ global $a, $db; @@ -36,21 +37,25 @@ function gprobe_run($argv, $argc){ dbesc(normalise_link($url)) ); - if(count($r)) - return; - - $arr = probe_url($url); + if(! count($r)) { - if(count($arr) && x($arr,'network') && $arr['network'] === NETWORK_DFRN) { - q("insert into `gcontact` (`name`,`url`,`nurl`,`photo`) - values ( '%s', '%s', '%s', '%s') ", - dbesc($arr['name']), - dbesc($arr['url']), - dbesc(normalise_link($arr['url'])), - dbesc($arr['photo']) + $arr = probe_url($url); + if(count($arr) && x($arr,'network') && $arr['network'] === NETWORK_DFRN) { + q("insert into `gcontact` (`name`,`url`,`nurl`,`photo`) + values ( '%s', '%s', '%s', '%s') ", + dbesc($arr['name']), + dbesc($arr['url']), + dbesc(normalise_link($arr['url'])), + dbesc($arr['photo']) + ); + } + $r = q("select * from gcontact where nurl = '%s' limit 1", + dbesc(normalise_link($url)) ); } - + if(count($r)) + poco_load(0,0,$r[0]['id'], str_replace('/profile/','/poco/',$r[0]['url'])); + return; } |