Skip to content

hipyhop/WebService-WhatPulse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NAME
    WebService::WhatPulse - Perl module for retrieving WhatPulse.org user or team
    stats

VERSION
    VERSION 0.1

SYNOPSIS
        use WebService::WhatPulse;

        my $wp = WebService::WhatPulse->new;

        my $stats = $wp->get_user('hipyhop');

        while(my ($key, $value) = each %{$stats}){
            print "$key: $value\n";
        }

        if($stats{'TeamID'} != 0){
            my $team_stats = $wp->get_team($stats{'TeamID'});

            while(my ($key, $value) = each %{$team_stats}){
                print "$key: $value\n";
            }
        }

DESCRIPTION
    This module provides a perl interface to the WhatPulse APIs.

    If an XML attribute is empty, for example if the user is not part of a
    team, the attribute will be surpressed and not appear in the returned
    data structure. Therefore always check for the existence of an attribute
    before attempting to use it.

METHODS AND ARGUMENTS

new

    This constructs a C<WebService::WhatPulse> object with the default settings. Named parameters can be optionally supplied to change the behaviour of the instance.

    apiurl

        This is the default URL of the API, defaults to http://whatpulse.org/api. Modify this if the URL changes or to use a custom server.

        Use of 'file:/' is allowed to access local files.

    user_endpoint

        The API endpoint to query for User stats. Defaults to '/user.php?UserID='. The username will be concatenated by the get_user method.

    team_endpoint

        The API endpoint to query for Team stats. Defaults to '/team.php?TeamID='. The team id will be concatenated by the get_user method.

    useragent_str

        A string to be used as the useragent string. Defaults to "WebService-WhatPulse/$VERSION".

    ua

        An LWP::UserAgent instance for querying the WhatPulse WebAPI.

get_user($username)

    Retrieve a HashRef of the User statistics by the username or numeric user_id.

get_team($team_id)

    Retrieves a HashRef of the Team statistics by the numeric team_id.

SUPPORT

    Please submit all issues to the project page at L<http://github.com/hipyhop/webservice-whatpulse>

AUTHOR

    Thomas Luff <tomfluff at me dot com>

About

A Perl interface to the WhatPulse API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages