diff options
author | Evan Prodromou <evan@status.net> | 2010-02-21 21:36:36 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-02-21 21:36:36 -0500 |
commit | fde64ddf2688fa0bd78e3d59f4003c3392fe2d30 (patch) | |
tree | 5ce5b913cb8a300299a5f1b75b990cfe0215d507 /plugins/OStatus | |
parent | 37179a91d5e176a743453cf27de606553bd62f36 (diff) |
make some of the Webfinger magic strings constants
Diffstat (limited to 'plugins/OStatus')
-rw-r--r-- | plugins/OStatus/lib/webfinger.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/plugins/OStatus/lib/webfinger.php b/plugins/OStatus/lib/webfinger.php index 417d54904..0386881d1 100644 --- a/plugins/OStatus/lib/webfinger.php +++ b/plugins/OStatus/lib/webfinger.php @@ -32,11 +32,16 @@ define('WEBFINGER_SERVICE_REL_VALUE', 'lrdd'); /** * 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); @@ -46,7 +51,7 @@ class Webfinger if (!$links) { return false; } - + $services = array(); foreach ($links as $link) { if ($link['template']) { @@ -64,7 +69,7 @@ class Webfinger 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); } @@ -86,7 +91,7 @@ class Webfinger if ($result->host != $domain) { return false; } - + $links = array(); foreach ($result->links as $link) { if ($link['rel'] == WEBFINGER_SERVICE_REL_VALUE) { @@ -140,4 +145,3 @@ class Webfinger } } - |