'Returns the user\'s list of followees and followers.
Followees are users in his Delicious "network", i.e. those users whose
bookmark streams he\'s subscribed to. Followers are his Delicious.com
"fans", i.e. those users who have subscribed to the given user\'s
bookmark stream).
Example:
A -------->   --------> C
D --------> B --------> E
F -------->   --------> F
followers               followees
of B                    of B
Arrows from user A to user B denote that A has subscribed to B\'s
bookmark stream, i.e. A is "following" or "tracking" B.
Note that user F is both a followee and a follower of B, i.e. F tracks
B and vice versa. In Delicious.com terms, F is called a "mutual fan"
of B.
Comparing this network concept to information retrieval, one could say
that followers are incoming links and followees outgoing links of B.
@param username: Delicous.com username for which network information is
retrieved.
@type username: unicode/str
@return: Tuple of two lists ([<followees>, [<followers>]), where each list
contains tuples of (username, tracking_since_timestamp).
If a network is set as private, i.e. hidden from public view,
(None, None) is returned.
If a network is public but empty, ([], []) is returned.'

def get_network(self, username):

    assert username
    followees = followers = None
    path = ('/v2/json/networkmembers/%s' % username)
    data = None
    try:
        data = self._query(path, host='feeds.delicious.com')
    except DeliciousForbiddenError:
        pass
    if data:
        followees = []
        users = []
        try:
            users = simplejson.loads(data)
        except TypeError:
            pass
        uname = tracking_since = None
        for user in users:
            try:
                uname = user['user']
            except KeyError:
                pass
            if uname:
                try:
                    uname = uname.decode('utf-8')
                except UnicodeDecodeError:
                    pass
            try:
                tracking_since = datetime.datetime.strptime(user['dt'], '%Y-%m-%dT%H:%M:%SZ')
            except KeyError:
                pass
            if uname:
                followees.append((uname, tracking_since))
    path = ('/v2/json/networkfans/%s' % username)
    data = None
    try:
        data = self._query(path, host='feeds.delicious.com')
    except DeliciousForbiddenError:
        pass
    if data:
        followers = []
        users = []
        try:
            users = simplejson.loads(data)
        except TypeError:
            pass
        uname = tracking_since = None
        for user in users:
            try:
                uname = user['user']
            except KeyError:
                pass
            if uname:
                try:
                    uname = uname.decode('utf-8')
                except UnicodeDecodeError:
                    pass
            try:
                tracking_since = datetime.datetime.strptime(user['dt'], '%Y-%m-%dT%H:%M:%SZ')
            except KeyError:
                pass
            if uname:
                followers.append((uname, tracking_since))
    return (followees, followers)
