Skip to content

HTTPリクエストした画像をローカルに保存する。更新確認フラグを立てると、同一URLが更新されているかの確認を行い、自動で上書きもする。

Notifications You must be signed in to change notification settings

rin1024/Sorauta-Cache-HTTP-Request-Image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.


About

HTTPリクエストした画像をローカルに保存する。更新確認フラグを立てると、同一URLが更新されているかの確認を行い、自動で上書きもする。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages