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

NAME

Net::Download::XMLScripted::XMLScripted - Perl XML scripted download program

SYNOPSIS

  use Net::Download::XMLScripted::XMLScripted;
  
  To Run from Command Line:
  
  (1) perl XMLScripted.pm -inXMLFileName xmlFileName [-verbose]

  (2) perl XMLScripted.pm -inXMLFileName xmlFileName -beginDate YYYY-MM-DD [-endDate YYYY-MM-DD]

  (3) perl XMLScripted.pm -generateSampleXMLFile sampleXMLFileName

  (4) perl XMLScripted.pm -showTranslationRules

  (5) perl XMLScripted.pm -version

DESCRIPTION

This is a daily download program. The input is an XML file that has information about URLs that need to be downloaded. It uses specific translation rules to generate URL names that contain dates. It creates directories specified in the input XML file and downloads the URLs. This module is ideal for cron jobs.

EXPORT

None by default.

SEE ALSO

perl(1) LWP::UserAgent HTTP::Request HTTP::Response URI::Heuristic XML::Parser

AUTHOR

Singh T. Junior, <tsingh@gmail.com<gt>

COPYRIGHT AND LICENSE

Copyright (C) 2006 by Singh T. Junior

All Rights Reserved.

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.6 or, at your option, any later version of Perl 5 you may have available.

sub getTranslationRules()

The function getTranslationRules() return a string that contains translation grammar.

sub createTranslationHash()

The function createTranslationHash() generates the hash that contains the translation rules. It's input argument is an Epoch Time variable.

Example: $cio->createTranslationHash(time);

sub download()

The function dowload() performs the download operations. This includes creation of required directories.

sub getFullDirectoryName()

This function returns full Directory name given a main path and a subdirectory.

sub writeStatusReport()

This function creates status report in the download directory.

sub getOperatingSystem()

The getOperatingSystem() function returns the type of Operating System.

sub printUsage()

This program prints the usage of mainXMLScripted.

sub getVersion()

Returns current version of the program.

sub generateSampleXMLFile()

Generates sample XML file that can be modified and used as input.

sub runEngine()

This routine is responsible for performing the actual task. It's arguments are input xmlFileName, beginDate, and endDate. The format of date is YYYY-MM-DD. Ex: runEngine("/tmp/input.xml", "2007-07-04", "2007-07-04");

sub run()

This routine is called by the instance of the XMLScripted object and it runs the program.

  • # Create XMLScripted Object

  • my $cio = Net::Download::XMLScripted::XMLScripted::->new();

  • # Run it

  • $cio->run();

1 POD Error

The following errors were encountered while parsing the POD:

Around line 659:

'=item' outside of any '=over'

=over without closing =back