rin1024/Sorauta-Cache-HTTP-Request-Image
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
Sorauta-Cache-HTTP-Request-Image version 0.01
============================
The README is used to introduce the module and provide instructions on
how to install the module, any machine dependencies it may have (for
example C compilers and installed libraries) and any other information
that should be provided before the module is installed.
A README file is required for CPAN modules since CPAN extracts the
README file from a module distribution so that people browsing the
archive can use it get an idea of the modules uses. It is usually a
good idea to provide version information here so that people can
decide whether fixes for the module are worth downloading.
INSTALLATION
To install this module type the following:
perl Makefile.PL
make
make test
make install
HOW TO USE
basic use:
use Sorauta::Cache::HTTP::Request::Image;
my $CACHE_PATH = '/tmp/';
my $SAMPLE_URLS = [
'http://www.google.co.jp/images/srpr/logo3w.png',
# 'http://sorauta.net/images/common/author.jpg',
];
my $MAX_WIDTH = 900;
my $MAX_HEIGHT = 1600;
my $DEBUG = 0; # show debug log
my $CHECK = 0; # check updated cache image
my $RENDER = 0; # show image
# get test
{
# テスト用
my $url = $SAMPLE_URLS->[int(rand(@$SAMPLE_URLS))];
# キャッシュ生成
my $result = Sorauta::Cache::HTTP::Request::Image->new({
cache_path => $CACHE_PATH,
url => $url,
check => $CHECK,
render => $RENDER,
debug => $DEBUG,
})->execute;
ok($result, "get request image");
}
DEPENDENCIES
This module requires these other modules and libraries:
LWP::UserAgent
Sorauta::Utility
COPYRIGHT AND LICENCE
Put the correct copyright and licence information here.
Copyright (C) 2012 by Yuki ANAI
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.12.3 or,
at your option, any later version of Perl 5 you may have available.