NAME
E2::Usergroup - A module for loading usergroup lists from http://everything2.com.
SYNOPSIS
use E2::Usergroup;
my $group = new E2::Usergroup;
$group->login( "username", "password" ); # See E2::Interface
if( $group->load( "edev" ) ) { # See E2::Node
print "Listing for group " . $group->title; # See E2::Node
print "\n(Description: " . $group->description . ")";
print "\nMembers:\n";
foreach my $m ($group->list_members) {
print " " . $m->{name} . "\n";
}
# Note, this weblog listing will only be available to
# members of this group.
print "\nWeblog:\n";
foreach my $w ($group->list_weblog) {
print " " . $w->{title} . "\n";
}
}
DESCRIPTION
This module provides access to http://everything2.com's usergroup lists. It inherits E2::Node.
CONSTRUCTOR
- new
-
new
creates a newE2::Usergroup
object. Until that object is logged in in one way or another (see E2::Interface), it will use the "Guest User" account, and will be limited in what information it can fetch and which operations it can perform.
METHODS
- $group->clear
-
clear
clears all the information currently stored in $group. - $group->description
-
This method returns the description string of the currently-loaded usergroup. It returns
undef
if no usergroup is loaded. - $group->list_members
-
This method returns a list of hashrefs corresponding to each member of the currently-loaded usergroup. It returns an empty list if the usergroup has no members, and
undef
if no usergroup is loaded.The keys to the returned hashrefs are the following:
name # Username id # user_id
- $group->list_weblog
-
This method returns a list of hashrefs corresponding to each item in the currently-loaded usergroup's weblog. Keys to the hashrefs are the following:
title # Title of the weblogged node id # node_id of the weblogged node
NOTE: To recieve this weblog, the user must be logged in and must be a member of this usergroup. If the usergroup has no weblog or if the user has no access to it, this method returns an empty list. If there is no usergroup currently loaded, this method returns
undef
.
SEE ALSO
E2::Interface, E2::Node, http://everything2.com, http://everything2.com/?node=clientdev
AUTHOR
Jose M. Weeks <jose@joseweeks.com> (Simpleton on E2)
COPYRIGHT
This software is public domain.