Source for file User.php
Documentation is available at User.php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
* User class for Digg API
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
* @author Joe Stump <joe@joestump.net>
* @copyright 1997-2007 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @link http://pear.php.net/package/Services_Digg
* @author Joe Stump <joe@joestump.net>
* This overloaded method handles '/user/{user name}/{endpoint}', such as
* '/user/joestump/diggs'. It does not handle more detailed endpoints, such
* ss '/user/joestump/activity/comments', which has its own method.
* @param string $function Simple endpoint for users
* @param array $args Arguments to pass to API
* @throws Services_Digg_Exception
public function __call($function, $args)
if (!isset ($args[0 ]) || !strlen($args[0 ])) {
if (isset ($args[1 ]) && count($args[1 ])) {
$endPoint = '/user/' . $username . '/' . $function;
* Get a user's comment activity
* @param string $username
* @throws Services_Digg_Exception
$endPoint = '/user/' . $username . '/activity/comments';
* Get a user's digg activity
* @param string $username
* @throws Services_Digg_Exception
$endPoint = '/user/' . $username . '/activity/diggs';
* Is the user friends with a person
* Checks to see if the given $username is friends with the currently
* instantiated user from $this->name.
* @param string $username Username to check against
* @param string $friend Username to check for
public function isFriend($username, $friend)
$endPoint = '/user/' . $username . '/friend/' . $friend;
* Is the person a fan of this user
* Checks to see if the given $username is a fan of the currently
* instantiated user from $this->name.
* @param string $username Username to check against
* @param string $fan Username to check for
public function isFan($username, $fan)
$endPoint = '/user/' . $username . '/fan/' . $fan;
* Get a user's friends' submissions
* @param string $username Username to get friends' subs
* @throws Services_Digg_Exception
$endPoint = '/user/' . $username . '/friends/submissions';
* Get a user's friends' dugg stories
* @param string $username Username to get friends' duggs
* @throws Services_Digg_Exception
$endPoint = '/user/' . $username . '/friends/dugg';
* Get a user's friends' commented stories
* @param string $username Username to get friends' cmts
* @throws Services_Digg_Exception
$endPoint = '/user/' . $username . '/friends/commented';
* Get a user's friends' popular stories that they dugg
* @param string $username
* @throws Services_Digg_Exception
$endPoint = '/user/' . $username . '/friends/popular';
* Get a user's friends' upcoming stories that they dugg
* @param string $username
* @throws Services_Digg_Exception
$endPoint = '/user/' . $username . '/friends/upcoming';
Documentation generated on Tue, 04 Dec 2007 15:00:13 -0500 by phpDocumentor 1.4.0. PEAR Logo Copyright © PHP Group 2004.
|