From 2a4e8972e0edfa3156d9ce54d68ce0e54c0ec289 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 18 Apr 2016 20:38:38 -0700 Subject: module updates --- Zotlabs/Module/Webfinger.php | 54 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 Zotlabs/Module/Webfinger.php (limited to 'Zotlabs/Module/Webfinger.php') diff --git a/Zotlabs/Module/Webfinger.php b/Zotlabs/Module/Webfinger.php new file mode 100644 index 000000000..c50680de7 --- /dev/null +++ b/Zotlabs/Module/Webfinger.php @@ -0,0 +1,54 @@ +Webfinger Diagnostic'; + + $o .= '
'; + $o .= 'Lookup address: '; + $o .= '
'; + + $o .= '

'; + + $old = false; + if(x($_GET,'addr')) { + $addr = trim($_GET['addr']); + // if(strpos($addr,'@') !== false) { + $res = webfinger_rfc7033($addr,true); + if(! $res) { + $res = old_webfinger($addr); + $old = true; + } + // } + // else { + // if(function_exists('lrdd')) + // $res = lrdd($addr); + // } + + if($res && $old) { + foreach($res as $r) { + if($r['@attributes']['rel'] === 'http://microformats.org/profile/hcard') { + $hcard = unamp($r['@attributes']['href']); + require_once('library/HTML5/Parser.php'); + $res['vcard'] = scrape_vcard($hcard); + break; + } + } + } + + + $o .= '
';
+			$o .= str_replace("\n",'
',print_r($res,true)); + $o .= '
'; + } + return $o; + } + +} -- cgit v1.2.3