GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  SCRAPPY::SESSION (3)

.ds Aq ’

NAME

Scrappy::Session - Scrappy Scraper Session Handling

CONTENTS

VERSION

version 0.94112090

SYNOPSIS



    #!/usr/bin/perl
    use Scrappy::Session;

    my  $session = Scrappy::Session->new;
   
        -f scraper.sess ?
        $session->load(scraper.sess);
        $session->write(scraper.sess);
       
        $session->stash(foo => bar);
        $session->stash(abc => [(a..z)]);



DESCRIPTION

Scrappy::Session provides YAML-Based session file handling for saving recorded data across multiple execution using the Scrappy framework.

    ATTRIBUTES

The following is a list of object attributes available with every Scrappy::Session instance.

auto_save

The auto_save attribute is a boolean that determines whether stash data is automatically saved to the session file on update.



    my  $session = Scrappy::Session->new;
       
        $session->load(scraper.sess);
        $session->stash(foo => bar);
       
        # turn auto-saving off
        $session->auto_save(0);
        $session->stash(foo => bar);
        $session->write; # explicit write



file

The file attribute gets/sets the filename of the current session file.



    my  $session = Scrappy::Session->new;
       
        $session->load(scraper.sess);
        $session->write(scraper.sess.bak);
        $session->file(scraper.sess);



METHODS

    load

The load method is used to read-in a session file, it returns its data in the structure it was saved-in.



    my  $session = Scrappy::Session->new;
    my  $data = $session->load(scraper.sess);



    stash

The stash method accesses the stash object which is used to store data to be written to the session file.



    my  $session = Scrappy::Session->new;
        $session->load(scraper.sess);
       
        $session->stash(foo => bar);
        $session->stash(abc => [(a..z)]);
        $session->stash->{123} = [(1..9)];



    write

The write method is used to write-out a session file, it saves the data stored in the session stash and it returns the data written upon completion.



    my  $session = Scrappy::Session->new;
   
        $session->stash(foo => bar);
        $session->stash(abc => [(a..z)]);
        $session->stash->{123} = [(1..9)];
   
    my  $data = $session->write(scraper.sess);



AUTHOR

Al Newkirk <awncorp@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2010 by awncorp.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 SCRAPPY::SESSION (3) 2011-07-28

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.