11 defined(
'JPATH_PLATFORM') or die();
34 public function getUser($user)
36 return $this->
get($user);
50 public function getFriends($user, $limit = 0, $offset = 0)
52 return $this->getConnection($user,
'friends',
'', $limit, $offset);
68 public function getFriendRequests($user, $limit = 0, $offset = 0, $until = null, $since = null)
70 return $this->getConnection($user,
'friendrequests',
'', $limit, $offset, $until, $since);
86 public function getFriendLists($user, $limit = 0, $offset = 0, $until = null, $since = null)
88 return $this->getConnection($user,
'friendlists',
'', $limit, $offset, $until, $since);
104 public function getFeed($user, $limit = 0, $offset = 0, $until = null, $since = null)
106 return $this->getConnection($user,
'feed',
'', $limit, $offset, $until, $since);
124 public function getHome($user, $filter = null, $location =
false, $limit = 0, $offset = 0, $until = null, $since = null)
130 $extra_fields =
'?filter=' . $filter;
133 if ($location ==
true)
135 $extra_fields .= (strpos($extra_fields,
'?') ===
false) ?
'?with=location' :
'&with=location';
138 return $this->getConnection($user,
'home', $extra_fields, $limit, $offset, $until, $since);
151 public function hasFriend($current_user, $user)
153 return $this->getConnection($current_user,
'friends/' . $user);
168 public function getMutualFriends($current_user, $user, $limit = 0, $offset = 0)
170 return $this->getConnection($current_user,
'mutualfriends/' . $user,
'', $limit, $offset);
184 public function getPicture($user, $redirect =
true, $type = null)
188 if ($redirect ==
false)
190 $extra_fields =
'?redirect=false';
195 $extra_fields .= (strpos($extra_fields,
'?') ===
false) ?
'?type=' . $type :
'&type=' . $type;
198 return $this->getConnection($user,
'picture', $extra_fields);
212 public function getFamily($user, $limit = 0, $offset = 0)
214 return $this->getConnection($user,
'family',
'', $limit, $offset);
231 public function getNotifications($user, $read = null, $limit = 0, $offset = 0, $until = null, $since = null)
235 $read =
'?include_read=1';
239 return $this->getConnection($user,
'notifications', $read, $limit, $offset, $until, $since);
251 public function updateNotification($notification)
255 return $this->createConnection($notification, null, $data);
269 public function getPermissions($user, $limit = 0, $offset = 0)
271 return $this->getConnection($user,
'permissions',
'', $limit, $offset);
284 public function deletePermission($user, $permission =
'')
286 return $this->deleteConnection($user,
'permissions',
'?permission=' . $permission);
302 public function getAlbums($user, $limit = 0, $offset = 0, $until = null, $since = null)
304 return $this->getConnection($user,
'albums',
'', $limit, $offset, $until, $since);
319 public function createAlbum($user, $name, $description = null, $privacy = null)
323 $data[
'name'] = $name;
324 $data[
'description'] = $description;
325 $data[
'privacy'] = $privacy;
327 return $this->createConnection($user,
'albums', $data);
343 public function getCheckins($user, $limit = 0, $offset = 0, $until = null, $since = null)
345 return $this->getConnection($user,
'checkins',
'', $limit, $offset, $until, $since);
363 public function createCheckin($user, $place, $coordinates, $tags = null, $message = null, $link = null, $picture = null)
367 $data[
'place'] = $place;
368 $data[
'coordinates'] = $coordinates;
369 $data[
'tags'] = $tags;
370 $data[
'message'] = $message;
371 $data[
'link'] = $link;
372 $data[
'picture'] = $picture;
374 return $this->createConnection($user,
'checkins', $data);
390 public function getLikes($user, $limit = 0, $offset = 0, $until = null, $since = null)
392 return $this->getConnection($user,
'likes',
'', $limit, $offset, $until, $since);
405 public function likesPage($user, $page)
407 return $this->getConnection($user,
'likes/' . $page);
423 public function getEvents($user, $limit = 0, $offset = 0, $until = null, $since = null)
425 return $this->getConnection($user,
'events',
'', $limit, $offset, $until, $since);
444 public function createEvent($user, $name, $start_time, $end_time = null, $description = null,
445 $location = null, $location_id = null, $privacy_type = null)
449 $data[
'start_time'] = $start_time;
450 $data[
'name'] = $name;
451 $data[
'end_time'] = $end_time;
452 $data[
'description'] = $description;
453 $data[
'location'] = $location;
454 $data[
'location_id'] = $location_id;
455 $data[
'privacy_type'] = $privacy_type;
457 return $this->createConnection($user,
'events', $data);
476 public function editEvent($event, $name = null, $start_time = null, $end_time = null, $description = null,
477 $location = null, $location_id = null, $privacy_type = null)
481 $data[
'start_time'] = $start_time;
482 $data[
'name'] = $name;
483 $data[
'end_time'] = $end_time;
484 $data[
'description'] = $description;
485 $data[
'location'] = $location;
486 $data[
'location_id'] = $location_id;
487 $data[
'privacy_type'] = $privacy_type;
489 return $this->createConnection($event, null, $data);
501 public function deleteEvent($event)
503 return $this->deleteConnection($event);
517 public function getGroups($user, $limit = 0, $offset = 0)
519 return $this->getConnection($user,
'groups',
'', $limit, $offset);
535 public function getLinks($user, $limit = 0, $offset = 0, $until = null, $since = null)
537 return $this->getConnection($user,
'links',
'', $limit, $offset, $until, $since);
551 public function createLink($user, $link, $message = null)
555 $data[
'link'] = $link;
556 $data[
'message'] = $message;
558 return $this->createConnection($user,
'feed', $data);
570 public function deleteLink($link)
572 return $this->deleteConnection($link);
588 public function getNotes($user, $limit = 0, $offset = 0, $until = null, $since = null)
590 return $this->getConnection($user,
'notes',
'', $limit, $offset, $until, $since);
605 public function createNote($user, $subject, $message)
609 $data[
'subject'] = $subject;
610 $data[
'message'] = $message;
612 return $this->createConnection($user,
'notes', $data);
628 public function getPhotos($user, $limit = 0, $offset = 0, $until = null, $since = null)
630 return $this->getConnection($user,
'photos',
'', $limit, $offset, $until, $since);
647 public function createPhoto($user, $source, $message = null, $place = null, $no_story = null)
651 $data[basename($source)] =
'@' . realpath($source);
652 $data[
'message'] = $message;
653 $data[
'place'] = $place;
654 $data[
'no_story'] = $no_story;
656 return $this->createConnection($user,
'photos', $data, array(
'Content-Type' =>
'multipart/form-data'));
673 public function getPosts($user, $location =
false, $limit = 0, $offset = 0, $until = null, $since = null)
675 if ($location ==
true)
677 $location =
'?with=location';
681 return $this->getConnection($user,
'posts', $location, $limit, $offset, $until, $since);
707 public function createPost($user, $message = null, $link = null, $picture = null, $name = null, $caption = null,
708 $description = null, $actions = null, $place = null, $tags = null, $privacy = null, $object_attachment = null)
712 $data[
'message'] = $message;
713 $data[
'link'] = $link;
714 $data[
'name'] = $name;
715 $data[
'caption'] = $caption;
716 $data[
'description'] = $description;
717 $data[
'actions'] = $actions;
718 $data[
'place'] = $place;
719 $data[
'tags'] = $tags;
720 $data[
'privacy'] = $privacy;
721 $data[
'object_attachment'] = $object_attachment;
722 $data[
'picture'] = $picture;
724 return $this->createConnection($user,
'feed', $data);
736 public function deletePost($post)
738 return $this->deleteConnection($post);
754 public function getStatuses($user, $limit = 0, $offset = 0, $until = null, $since = null)
756 return $this->getConnection($user,
'statuses',
'', $limit, $offset, $until, $since);
769 public function createStatus($user, $message)
773 $data[
'message'] = $message;
775 return $this->createConnection($user,
'feed', $data);
788 public function deleteStatus($status)
790 return $this->deleteConnection($status);
806 public function getVideos($user, $limit = 0, $offset = 0, $until = null, $since = null)
808 return $this->getConnection($user,
'videos',
'', $limit, $offset, $until, $since);
823 public function createVideo($user, $source, $title = null, $description = null)
827 $data[basename($source)] =
'@' . realpath($source);
828 $data[
'title'] = $title;
829 $data[
'description'] = $description;
831 return $this->createConnection($user,
'videos', $data, array(
'Content-Type' =>
'multipart/form-data'));
847 public function getTagged($user, $limit = 0, $offset = 0, $until = null, $since = null)
849 return $this->getConnection($user,
'tagged',
'', $limit, $offset, $until, $since);
865 public function getActivities($user, $limit = 0, $offset = 0, $until = null, $since = null)
867 return $this->getConnection($user,
'activities',
'', $limit, $offset, $until, $since);
883 public function getBooks($user, $limit = 0, $offset = 0, $until = null, $since = null)
885 return $this->getConnection($user,
'books',
'', $limit, $offset, $until, $since);
901 public function getInterests($user, $limit = 0, $offset = 0, $until = null, $since = null)
903 return $this->getConnection($user,
'interests',
'', $limit, $offset, $until, $since);
919 public function getMovies($user, $limit = 0, $offset = 0, $until = null, $since = null)
921 return $this->getConnection($user,
'movies',
'', $limit, $offset, $until, $since);
937 public function getTelevision($user, $limit = 0, $offset = 0, $until = null, $since = null)
939 return $this->getConnection($user,
'television',
'', $limit, $offset, $until, $since);
955 public function getMusic($user, $limit = 0, $offset = 0, $until = null, $since = null)
957 return $this->getConnection($user,
'music',
'', $limit, $offset, $until, $since);
971 public function getSubscribers($user, $limit = 0, $offset = 0)
973 return $this->getConnection($user,
'subscribers',
'', $limit, $offset);
987 public function getSubscribedTo($user, $limit = 0, $offset = 0)
989 return $this->getConnection($user,
'subscribedto',
'', $limit, $offset);