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



Annotate this POD

View/Report Bugs
Module Version: 0.32   Source  


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


        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";


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.



new creates an E2::User object.



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.


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


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


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


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


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


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


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


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'.


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


E2::Interface, E2::Node, E2::UserSearch,,


Jose M. Weeks <> (Simpleton on E2)


This software is public domain.

syntax highlighting: