Show
Ignore:
Timestamp:
04/01/08 21:02:22 (8 months ago)
Author:
yusukebe
Message:

add CACHING

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/WebService-Simple/trunk/example/flickr_echo.pl

    r8550 r8608  
    22use warnings; 
    33use WebService::Simple; 
     4use Cache::File; 
    45 
    56my $api_key = "your_api_key"; 
    6 my $flickr  = WebService::Simple->new( "http://api.flickr.com/services/rest/", 
    7     { api_key => $api_key, } ); 
     7my $cache   = Cache::File->new( 
     8    cache_root      => '/tmp/mycache', 
     9    default_expires => '30 min', 
     10); 
     11 
     12my $flickr = WebService::Simple->new( 
     13    base_url => "http://api.flickr.com/services/rest/", 
     14    cache    => $cache, 
     15    param    => { api_key => $api_key, } 
     16); 
     17 
    818my $response = 
    919  $flickr->get( { method => "flickr.test.echo", name => "value" } );