Jose Marti Weeks > E2-Interface-0.34 > E2::User

Download:
E2-Interface-0.34.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.32   Source  

NAME ^

E2::User - A module for loading user data and sorting and listing a user's writeups

SYNOPSIS ^

        use E2::User;

        # Display homenode info

        my $user = new E2::User;
        $user->load( "dem bones" ); # see E2::Node

        print $user->name;
        print "\nuser since: " . $user->createtime; # See E2::Node
        print "\nlast seen: " . $user->lasttime;
        print "\nnumber of writeups / XP: ";
        print $user->writeup_count . '/' . $user->experience;
        print "\nlevel: " . $user->level_string;
        print "\nC!s spent: " . $user->cool_count;
        print "\nmission drive within everything:\n\t";
        print $user->mission;
        print "\nspecialties:\n\t" . $user->specialties;
        print "\nschool/company:\n\t" . $user->employment;
        print "\nmotto:\n\t" . $user->motto;
        print "\nmember of:\n\t";

        foreach my $g ( $user->groups ) { print $g->{title} . ' '; }

        print "\nmost recent writeup:\n\t";
        print $user->lastnode;

        print "\n-------------------------------------\n\n";

        print $user->text;

        print "\n\nUser Bookmarks:\n";

        foreach my $g ( $user->bookmarks ) {
                print $g->{title};
                print "\n";
        }

DESCRIPTION ^

This module provides access to user information that is normally displayed on a user's homenode. It inherits E2::Node.

NOTE: E2::Node provides $user->createtime and other methods that might be useful in displaying user information.

CONSTRUCTOR ^

new

new creates an E2::User object.

METHODS ^

$user->name
$user->id
$user->lasttime

These return, respectively, the username, user_id, the time of account creation, and the last time the specified user was seen on E2.

NOTE: E2::Node provides $user->createtime, as well as other methods that might be useful in displaying user information.

$user->alias
$user->alias_id

These return, respectively, the username and user_id of this user's alias (for message forwarding) if he indeed has one.

$user->text

text returns the text of the "User Bio" section of the user's homenode.

$user->experience
$user->level
$user->level_string

These return, respectively, the XP number of the user in question, the level number, and the level including description text ("13 (Pseudo God)", etc.).

$user->writeup_count
$user->cool_count

These return, respectively, the number of writeups written by the user in question, and the number of C!s he has spent.

$user->image_url

image returns a relative URL to the homenode image of the user in question.

$user->lastnode
$user->lastnode_id

These return the name and id, respectively, of the most recent node written by this user.

$user->mission
$user->specialties
$user->motto
$user->employment

These return the strings that are displayed in the user's homenode regarding his mission drive, specialties, motto, and his employer or school.

$user->groups

groups returns a list of hashrefs corresponding to the groups which this user is a member. It only lists membership in 'gods', 'Content Editors', and 'edev'. Hash keys include 'title' and 'id'.

$user->bookmarks

bookmarks returns a list of hashrefs corresponding to the nodes that this user has bookmarked. Hash keys include 'title' and 'id'.

SEE ALSO ^

E2::Interface, E2::Node, E2::UserSearch, http://everything2.com, http://everything2.com/?node=clientdev

AUTHOR ^

Jose M. Weeks <jose@joseweeks.com> (Simpleton on E2)

COPYRIGHT ^

This software is public domain.

syntax highlighting: