NAME

WWW::Lunarstorm - Perl module for interacting with the Swedish community Lunarstorm

SYNOPSIS

        use strict;
        use WWW::Lunarstorm;

        my $lunar = new Lunarstorm(Username => 'myusername', Password => 'mypassword',
                                UserID => '{DEADBEAF-BABE-DEAD-BABE-DEADBEAFBABE}',
                                CookiePath => '/directory/to/place/cookiefile/in');

        $lunar->login() or die "Unable to login";
        $lunar->logout() or die "Unable to logout";

DESCRIPTION

This module provides functions for interacting with the Swedish community Lunarstorm (www.lunarstorm.se).

METHODS

Constructor

new()

Return a new Lunarstorm object. Valid attributes are:

Username

Your Lunarstorm username

Password

Your Lunarstorm password

UserID

Your Lunarstorm userid. This is a id use by lunarstorm internaly. Every user got an id in the form of {DEADBEAF-BABE-DEAD-BABE-DEADBEAFBABE}. This is needed to locate your personal guestbook etc.

I'll most likely remove this from the constructor in future versions.

login()

Logs in to the community. May be integrated in constructor in future versions. Returns 1 on success and 0 on failure.

logout()

Logs out from the cumminty. May be integrated in the destructor in f uture versions. Returns 1 on success and 0 on failure.

visitors()

Retrives a list of people who have visited you personal page.

    Returns a hash containing:

    NICK
    SEX
    AGE
    CITY
    STATE
    USERID

    USERID is the lunarstorm id.

guestbook()

Takes two arguments. Page number and userid. Page number is the page number which you wish to retrive guestbook entries from. Page number 1 represents the latest page in the guestbook. Userid is the lunarstorm id of the person whos guestbook you wish to read from. If left out, your own guestbook is read.

    Returns a hash containing:

    NICK
    SEX
    AGE
    CITY
    STATE
    USERID
    GUESTNR
    TEXT

    TEXT is the body of the message.

sign_guestbook()

Takes four arguments. Username, userid, guestbookitem id and the text you wish to sign the guestbook with. Username is the username of the user whos guestbook you are to sign. Userid is the users lunarstorm id. Guestbookitem id is a id given to every guestbook item. It is used to identify which item you replied to, so that it can be marked as answered. Returns 1 on success and 0 on failure.

relations()

Takes one optional argument, userid. Userid is the lunarstorm id of the person whos list of relations you wish to retrive. If left out, your own list of relations is retrived.

    Returns a hash containing:

    NICK
    SEX
    AGE
    CITY
    STATE
    USERID

    USERID is the lunarstorm id.

scribbles()

Takes zero arguments. Retrives all items in the scribble board.

    Returns a hash containing:

    NICK
    SEX
    AGE
    CITY
    STATE
    USERID
    TEXT

    TEXT is the body of the scribble.

scribble()

Takes one argument, the text you wish to write on the board. Returns 1 on success and 0 on failure.

relations_status()

Takes zero arguments. Retrievs a list of newly created, or ended relations. These are accapted with accept_relation().

    Returns a hash containing:

    NICK
    SEX
    AGE
    CITY
    STATE
    USERID
    TYPE

    If TYPE is "CLOSED", the relation is a closed one. Else TYPE contains a string containing the relation type.

accept_relation()

Takes one argument, a hash containing at least two variables: USERID and TYPE. It is recommened to just pass the hash returned by relations_status(). For example:

        my @relations = $lunar->relations_status();

        foreach my $relation (@relations){
                $lunar->accept_relation($relation);
        }

Returns 1 on success and 0 on failure.

REQUIERS

LWP::UserAgent, HTTP::Cookies, HTML::TableExtract, URI::Escape

AUTHOR

Martin Stenberg <bumby@evilninja.org>

COPYRIGHT

Copyright (c) 2004 Martin Stenberg All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

www.lolisa.org, AI::MegaHal.

4 POD Errors

The following errors were encountered while parsing the POD:

Around line 574:

You forgot a '=back' before '=head2'

Around line 576:

'=item' outside of any '=over'

Around line 603:

'=item' outside of any '=over'

Around line 799:

You forgot a '=back' before '=head1'