Yaron Kahanovitch

NAME

WWW::Monitor::Task - A Task class for monitoring single web page against a cached version.

VERSION

Version 0.1

Description

This class is responsible for tracking a single web page and reporting changes. This class should be considered as a private asset of WWW::Monitor. For details please refer to <WWW::Monitor>

EXPORT

FUNCTIONS

new

A constructor.

run ( mechanize, carrier, <cache>)

Executes Task. Parameters:

mechanize - Web mechanize object.

WWW::Monitor::Task assumes that the given object implements or inherits WWW::mechnize abstraction. See http://search.cpan.org/~petdance/WWW-Mechanize-1.20/lib/WWW/Mechanize.pm.

carrier- Object which will conduct the notification; see WWW::Monitor for details

cache - optional - A cache class.

be_notified

(Private method) Tests if a page has changed. If yes, notification call back is being called.

is_html

(Private method) Return true if page is html

missing_parts

Return hash reference which includes parts that exists only in old cached version. Every entry in the returned list is a reference to HTTP::REsponse object.

added_parts

Return hash reference which includes parts that exists only in the new cached version.Every entry in the returned list is a reference to HTTP::REsponse object.

old_version_time_stamp

Return the time when the url was previously cached. Time is returned in seconds since epoch.

new_version_time_stamp

Return the time when the url was queried. Time is returned in seconds since epoch.

changed_parts

Return a list that consists of all changed parts.

get_old_new_pair [ urls key ]

Return a list of two elements. The first one is the old cached version and the second one is the new version. The given url key must be one of the keys returned by changed_parts method. Each of the pair two pairs is a reference to HTTP::Response object.

format_html [ leftmargin, rightmargin]

Return a textual version of HTML left and right margins set the margin for the returned data.

get_hash_cache_key

(Private method) Return a hash key that stores information about the entire visible part or the URL.

get_cache_hash

(Private Method) Returns all urls which were last cached. return true if the url was previously hashed.

store_validity

(Private method) Store current time in the main hash key

validity

(private method) Retreive date validity of per stores url

store_cache_hash

Store General information of a web address, including all frames and dates.

sync_cache

(Private method)

get_url_data

(Private method)

success

return true upon success of the last run execution.

AUTHOR

Yaron Kahanovitch, <yaron-helpme at kahanovitch.com>

BUGS

Please report any bugs or feature requests to bug-www-monitor at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-Monitor. 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::Monitor You can also look for information at:

ACKNOWLEDGMENTS

COPYRIGHT & LICENSE

Copyright 2007 Yaron Kahanovitch, all rights reserved.

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

1; # End of WWW::Monitor::Task