Skip to content
Browse files

added getRelationships method and modified getSocialGraph to use rela…

…tionships table to expand the graph
  • Loading branch information...
1 parent 944b2bc commit 4e50a28b0b4fa5f763e4f59b848cea51f22fda51 @zagraves zagraves committed Jun 21, 2010
Showing with 13 additions and 1 deletion.
  1. +13 −1 lib/Yahoo/YahooOAuthApplication.class.php
View
14 lib/Yahoo/YahooOAuthApplication.class.php
@@ -256,6 +256,18 @@ public function getConnections($guid = null, $offset = 0, $limit = 10)
return isset($rsp->query->results) ? $rsp->query->results : false;
}
+
+ public function getRelationships($guid = null, $offset = 0, $limit = 10)
+ {
+ if($guid == null && !is_null($this->token))
+ {
+ $guid = $this->token->yahoo_guid;
+ }
+
+ $rsp = $this->yql(sprintf('SELECT * FROM social.relationships(%s,%s) WHERE owner_guid="%s"', $offset, $limit, $guid));
+
+ return isset($rsp->query->results) ? $rsp->query->results : false;
+ }
public function getContacts($guid = null, $offset = 0, $limit = 10)
{
@@ -407,7 +419,7 @@ public function getSocialGraph($guid = null, $offset = 0, $limit = 10)
$guid = $this->token->yahoo_guid;
}
- $query = sprintf('SELECT * FROM social.profile where guid in (SELECT guid from social.connections (%s, %s) WHERE owner_guid="%s");', $offset, $limit, $guid);
+ $query = sprintf('SELECT * FROM social.profile where guid in (SELECT guid from social.relationships (%s, %s) WHERE owner_guid="%s");', $offset, $limit, $guid);
$rsp = $this->yql($query);
return isset($rsp->query->results) ? $rsp->query->results : false;

0 comments on commit 4e50a28

Please sign in to comment.
Something went wrong with that request. Please try again.