Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    WWW::Sitebase::Poster 0.5

    Download button

    No screenshots available
    Downloads: 341  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Good (3.8/5)
    5 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Grant Grueninger | More programs
    Perl Artistic License / FREE
    April 8th, 2008, 11:52 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    WWW::Sitebase::Poster description

    WWW::Sitebase::Poster is a base Perl class for web site posting routines.

    WWW::Sitebase::Poster is a base Perl class for web site posting routines.

    SYNOPSIS

    package MyPostingModule;

    use WWW::Sitebase::Poster -Base;

    # Define your options
    sub default_options {
    my $options = super;

    $options->{cache_file} = { default => 'mypostingmodule' }; # (VERY IMPORTANT)
    $options->{my_option} = 0; # 0 = not required. 1 means required.
    $options->{my_option} = { default => 'mydefault' }; # Sets a default for your option.

    # Some common example options, say for posting messages or comments:
    $options->{subject} = 1; # Require subject
    $options->{message} = 1; # Require a message

    return $options;

    }

    # Add accessors if you like (usually a good idea)
    # (Poster.pm already gives you the cache_file accessor).
    field 'my_option';
    field 'subject';
    field 'message';

    # Define your send_post method (see examples below)
    sub send_post {

    my ( $friend_id ) = @_;

    $result = $self->browser->do_something( $friend_id, $other_value );

    # ... Do anything else you need ...

    return $result; # $result must be P, R, F, or undef. (Pass, Retry, Fail, or stop)

    }


    ----------------
    Then you or others can write a script that uses your module.

    #!/usr/bin/perl -w

    use MyPostingModule;
    use WWW::Myspace;

    my @friend_list = &fancy_friend_gathering_routine;

    my $poster = new MyPostingModule(
    browser => new WWW::Myspace, # Note, this'll prompt for username/password
    friend_ids => @friend_list,
    subject => 'hi there!',
    message => 'I'm writing you a message!',
    noisy => 1,
    interactive => 1,
    );

    $poster->post;

    This is a base class for modules that need to post things and remember to whom they've posted. If you're writing a new module that needs to send something and remember stuff about it, you'll want to look at this module. It gives you all sorts of neat tools, like write_log and read_log to remember what you did, and it automatically parses all your arguments right in the new method, and can even read them from a config file in CFG or YAML format. All the "new" method stuff it just inherits from WWW::Sitebase, so look there for more info.

    The cache_file is where write_log and read_log write and read their data.

    You MUST set the cache_file default to something specific to your module. This will be used by the cache_file method to return (and create if needed) the default cache file for your module. Make sure it's unique to "Poster" modules. (Hint: name it after your module). Your default filename will be placed in the value returned by $self->cache_dir (.www-poster by default), so don't specify a path. If you're writing a WWW::Myspace module, you should override cache_dir. See "cache_dir" below.

    This module itself is a subclass of WWW::Sitebase, so it inherits "new", default_options, and a few other methods from there. Be sure to read up on WWW::Sitebase if you're not familiar with it, as your class will magically inherit those methods too.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    website posting | posting routines | Perl module | website | posting | routines

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM