The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WWW::PerlMonks - [Alpha Release] This module provides access to PerlMonks.

VERSION

Version 0.01 ** Alpha Release **

SYNOPSIS

This module provides access to PerlMonks.

This is an Alpha release, there are features such as posting posts and replies that are not implemented ( See TODO section ).

Details on the Original API can be found at http://www.perlmonks.org/?node_id=72241

Each function returns a hash that consists of the original XML parsed through XML::Smart - The original XML can be accessed through $result->{ RAW_XML }

Example:

    use WWW::PerlMonks;

    my $ob = new WWW::PerlMonks( 
        USERNAME   =>   'username'      , # Optional - Required for functions that require authentication. 
        PASSWORD   =>   'password'      , # Optional - Required for functions that require authentication. 
        USER_AGENT =>   'WWW_PerlMonks' , # Optional - default 'WWW_PerlMonks' . $VERSION 
        DEBUG      =>   0               , # Optional - default - 0
        );

    # my $hash = $ob->get_chatterbox()                             ;
    # my $hash = $ob->get_private_messages()                       ;
    # my $hash = $ob->send_chatter()                               ;     # Unimplemented
    # my $hash = $ob->get_user_nodes_info()                        ;
    # my $hash = $ob->get_user_nodes_reputation()                  ;
    # my $hash = $ob->get_user_XP()                                ;
    # my $hash = $ob->get_online_users()                           ;
    # my $hash = $ob->get_newest_nodes()                           ;
    # my $hash = $ob->get_node_details( [ '72241', '507312' ] )    ;
    # my $hash = $ob->get_node_thread( '1015083' )                 ;
    # my $hash = $ob->get_scratch_pad()                            ;     # Unimplemented
    # my $hash = $ob->get_best_nodes()                             ;
    # my $hash = $ob->get_worst_nodes()                            ;
    # my $hash = $ob->get_selected_best_nodes()                    ;
    # my $hash = $ob->get_nav_info_for_node('72241')               ;

EXPORT

The is an Object Oriented Modules and does not export anything.

SUBROUTINES/METHODS

new

Usage:

    my $ob = new WWW::PerlMonks( 
        USERNAME   =>   'username'      , # Optional - Required for functions that require authentication. 
        PASSWORD   =>   'password'      , # Optional - Required for functions that require authentication. 
        USER_AGENT =>   'WWW_PerlMonks' , # Optional - default 'WWW_PerlMonks' . $VERSION 
        DEBUG      =>   0               , # Optional - default - 0
        );

get_chatterbox

This function retrieves the recents comments on the PerlMonks Chatterbox.

Authentication: Not required.

Parameters : None .

get_private_messages

This function retrieves private messages in the inbox of the authenticated user.

Authentication: Required .

Parameters : None .

send_chatter [ Unimplemented ]

Unimplemented - Original API seems to have a problem.

This function sends chatter to the PerlMonks chatterbox on behalf of the authenticated user.

Authentication: Required .

Parameters : Chatter .

get_user_nodes_info

This function returns details of a user. If authenticated the user param is optional and it will default to the authenticated user. Also reputation is available only when authenticated.

Authentication: Required for 'reputation' .

Parameters : user if not authenticated, default is authenticated user.

get_user_nodes_reputation

Returns reputation information about recently voted on nodes owned by the logged in user. Returns those nodes voted on since the last fetch or the past 24 hours whichever is shorter. Will return an error code if called sooner than 10 minutes after the last fetch.

WARNING: Required min time between hits is 10 min.

Authentication: Required .

Parameters : None .

get_user_XP

This function returns the XP and other basic details of a user. If authenticated the user param is optional and it will default to the authenticated user. Also 'votesleft' is available only when authenticated.

Authentication: Required for 'votesleft' .

Parameters : user if not authenticated, default is authenticated user.

get_online_users

This function returns a list of currently online users.

Authentication: Not Required.

Parameters : None.

get_newest_nodes

This function returns a list of new nodes.

Authentication: Not Required.

Parameters : Optional - 'unix timestamp' of earliest message ( cannot be more than 8 days - 691200 sec - ago )

get_node_details

This function returns information about specific nodes.

Authentication: Not Required.

Parameters : Required: reference to array containing node ids.

get_node_thread

This function returns the node IDs of a thread, properly nested.

Authentication: Not Required.

Parameters : Required: nodeID of node to get thread of.

get_scratch_pad [ Unimplemented ]

Unimplemented! There seems to be a problem with the original API.

get_best_nodes

This function returns a list of the best nodes.

Authentication: Not Required.

Parameters : None .

get_worst_nodes

This function returns a list of the worst nodes.

Authentication: Required.

Parameters : None .

get_selected_best_nodes

This function returns a list of the all time best nodes.

Authentication: Not Required .

Parameters : None .

get_nav_info_for_node

This function provides an interface to the Navigational Nodelet - Description from Original API Follows:

PerlMonks automation clients can use this to spider the site in various ways. Its concept of operation is just like that of the Node Navigator nodelet: given a node (by ID), it reports the previous and next node, the previous and next of the same node type (e.g. Meditation), and the previous and next by the same author. Optionally, it lets you request the previous/next node, relative to the given node, of a different type or by a different author.

Information on the search, including the search parameters and any error conditions, is reported in the <info> "header" element of the result.

Authentication: Not Required .

Parameters :

           nodeID   - of the reference node ( Required )
           nodetype - id of the desired node type (optional)
           author   - id of the desired author (that is, their homenode id) (optional)

INTERNAL SUBROUTINES/METHODS

These functions are used by the module. They are not meant to be called directly using the Net::XMPP::Client::GTalk object although there is nothing stoping you from doing that.

_get_from_url

This function retrieves the contents of a web url.

_get_function_to_url_hash

This function provides the mapping from functions used within this module and the PerlMonks API.

_find_user_to_use

This function picks the user to use based on context, user passed and ( if exists ) authenticated user.

AUTHOR

Harish Madabushi, <harish.tmh at gmail.com>

BUGS

Please report any bugs or feature requests to bug-www-perlmonks at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-PerlMonks. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc WWW::PerlMonks

You can also look for information at:

LICENSE AND COPYRIGHT

Copyright 2013 Harish Madabushi.

This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:

http://www.perlfoundation.org/artistic_license_2_0

Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license.

If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license.

This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder.

This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed.

Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.