E2::Usergroup - A module for loading usergroup lists from http://everything2.com.
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"; } }
This module provides access to http://everything2.com's usergroup lists. It inherits E2::Node.
new creates a new E2::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.
new
E2::Usergroup
clear clears all the information currently stored in $group.
clear
This method returns the description string of the currently-loaded usergroup. It returns undef if no usergroup is loaded.
undef
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
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.
E2::Interface, E2::Node, http://everything2.com, http://everything2.com/?node=clientdev
Jose M. Weeks <jose@joseweeks.com> (Simpleton on E2)
This software is public domain.
To install E2::Interface, copy and paste the appropriate command in to your terminal.
cpanm
cpanm E2::Interface
CPAN shell
perl -MCPAN -e shell install E2::Interface
For more information on module installation, please visit the detailed CPAN module installation guide.