diff options
author | Evan Prodromou <evan@prodromou.name> | 2008-06-02 13:42:49 -0400 |
---|---|---|
committer | Evan Prodromou <evan@prodromou.name> | 2008-06-02 13:42:49 -0400 |
commit | 03677f1a81bcde5541bda6322e0dd0b0fb847ecd (patch) | |
tree | dd61c81f612a72d8acc4520e019a49d0c9e2881b /lib | |
parent | 7743348d24800506c478cf8567bdb3282109688e (diff) |
better handling of XRDS files
Our generated XRDS files contain 3 XRD elements: one for OAuth, one
for OMB, and one to point to the other two. Auth_Yadis only gives us
the last one, so we have to use it to find the other two, and then
extract service URLs from them.
Kind of fragile code, probably won't hold up under complicated
topologies, and won't work at all if the XRDs are in another XRDS
container. I tried to use XRDS filtering to get the top-priority
version of XRDs, services, and URIs, but Laconica's output doesn't use
any of that stuff and I don't particularly want to test it.
darcs-hash:20080602174249-84dde-b7ffdf7f21afb5b734def70530fc305689da471d.gz
Diffstat (limited to 'lib')
-rw-r--r-- | lib/omb.php | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/omb.php b/lib/omb.php index 13a2f7adf..91c1906e3 100644 --- a/lib/omb.php +++ b/lib/omb.php @@ -59,4 +59,18 @@ function omb_hmac_sha1() { $hmac_method = new OAuthSignatureMethod_HMAC_SHA1(); } return $hmac_method; -}
\ No newline at end of file +} + +function omb_service_uri($service) { + $uris = $service->getURIs(); + if (!$uris) { + return NULL; + } + return $uris[0]; +} + +function omb_local_id($service) { + $els = $service->getElements('LocalID'); + return ($els) ? $els[0] : NULL; +} + |