Andrew Pavlutkin > WWW-phpBB-Poster-0.02 > WWW::phpBB::Poster

Download:
WWW-phpBB-Poster-0.02.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.02   Source   Latest Release: WWW-phpBB-Poster-0.03

NAME ^

WWW::phpBB::Poster - phpBB forum poster

SYNOPSIS ^

    use WWW::phpBB::Poster;

    # scrape as guest
    my $phpbb   =   WWW::phpBB::Poster->new({
        db_host     =>  'localhost',
        db_user     =>  'root',
        db_password =>  'somepass',
        db_database =>  'forum',
        db_prefix   =>  'phpbb_',
        db_type     =>  'mysql',
        db_charset  =>  'utf8'
    });
    
    if(!$phpbb){
        die(qq[Cannot establish connection!\n]);
    }
    my $forums_list = $phpbb->getForums();

DESCRIPTION ^

I wrote this module for own purposes - exactly for generating SEO-ready forums, already filled in with some parsed data. Hope, it shall be useful for you :)

P.S. It handles only MySQL or SQLite phpBB installation.

P.P.S. It is NOT suggested for fork using - if so - you may got strange results with posts and topics. If you want to use this module with forks - please, fix it manually for InnoDB using - commiting, etc.

REQUIRED MODULES ^

DBI

Digest::MD5

EXPORT ^

None.

CONSTRUCTOR ^

new()

Creates a new WWW::phpBB::Poster object.

Required parameters: HASH REF

Optional parameters: HASH REF

PUBLIC METHODS ^

$phpbb->setUser()

Tries to select user from DB, if none - tries to insert user into DB. Returns ID of user.

Required parameters: HASH REF

Optional parameters: HASH REF

$phpbb->getUser($intUserID)

Gets user data by ID. Returns a hash of values

$phpbb->getForumList()

Selects all forums, having parent id (exactly forums, not categories) from DB. Returns a ref to an array, where first key is forum ID, and second - forum name.

$phpbb->setTopic()

Tries to select topic by title and forum id from DB, if none - tries to insert topic into DB and then makes necessary updates with other tables and increases the user post count.

Returns ID of topic.

Required parameters: HASH REF

Optional parameters: HASH REF

$phpbb->getTopic($intTopicID)

Gets topic data by ID. Returns a hash of values

$phpbb->setPost()

Adds post content to topic.

Returns ID of post or undef if no such topic or user.

Required parameters: HASH REF

Optional parameters: HASH REF

$phpbb->getTopicList($intLimit)

Gets topics list. If limit is undefined, method will return you the whole list of topics. Return format: array of arrays - first key is topic ID, second - topic name.

$phpbb->syncForums()

Syncs forum's count of posts, topics, post_id, poster_id.

AUTHOR ^

Andrew Jumash, <skazo4nik@gmail.com>

COPYRIGHT AND LICENSE ^

Copyright (C) 2010 by Andrew Jumash, http://www.skazkin.ru

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: