/**
* Implement the webfinger protocol.
*/
+
class Webfinger
{
+ const PROFILEPAGE = 'http://webfinger.net/rel/profile-page';
+ const UPDATESFROM = 'http://schemas.google.com/g/2010#updates-from';
+
/**
* Perform a webfinger lookup given an account.
- */
+ */
+
public function lookup($id)
{
$id = $this->normalize($id);
if (!$links) {
return false;
}
-
+
$services = array();
foreach ($links as $link) {
if ($link['template']) {
function normalize($id)
{
if (substr($id, 0, 7) == 'acct://') {
- return substr($id, 7);
+ return substr($id, 7);
} else if (substr($id, 0, 5) == 'acct:') {
return substr($id, 5);
}
if ($result->host != $domain) {
return false;
}
-
+
$links = array();
foreach ($result->links as $link) {
if ($link['rel'] == WEBFINGER_SERVICE_REL_VALUE) {
}
}
-