Changeset 10275
- Timestamp:
- 04/24/08 13:22:15 (6 months ago)
- Location:
- lang/perl/WebService-Simple/trunk
- Files:
-
- 8 modified
-
Changes (modified) (1 diff)
-
Makefile.PL (modified) (1 diff)
-
README (modified) (2 diffs)
-
example/flickr_echo.pl (modified) (2 diffs)
-
example/flickr_search.pl (modified) (2 diffs)
-
example/lingr.pl (modified) (4 diffs)
-
lib/WebService/Simple.pm (modified) (2 diffs)
-
lib/WebService/Simple/Response.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/WebService-Simple/trunk/Changes
r8870 r10275 1 1 Revision history for WebService-Simple 2 2 3 0.0 .3 Fri Apr 04 15:41:00 20083 0.03 Fri Apr 04 15:41:00 2008 4 4 - Fixed Makefile.PL and Build.PL 5 0.0 .2 Thu Apr 03 16:13:00 20085 0.02 Thu Apr 03 16:13:00 2008 6 6 - Added CHACHING 7 0.0 .1 Thu Mar 27 10:06:09 20087 0.01 Thu Mar 27 10:06:09 2008 8 8 - original version -
lang/perl/WebService-Simple/trunk/Makefile.PL
r10117 r10275 19 19 build_requires( 'Test::More' ); 20 20 build_requires( 'Test::Pod' ); 21 build_requires( 'Test::Pod::Coverage' );22 21 23 22 auto_include; -
lang/perl/WebService-Simple/trunk/README
r8870 r10275 3 3 DESCRIPTION 4 4 5 WebService::Simple provides you a simple interface to Web Services APIs. 5 WebService::Simple is a simple class to interact with web services. 6 7 It's basically an LWP::UserAgent that remembers recurring api URLs and 8 parameters, plus sugar to parse the results. 6 9 7 10 INSTALLATION … … 14 17 make install 15 18 16 Alternatively, to install with Module::Build, you can use the following commands:17 18 perl Build.PL19 ./Build20 ./Build test21 ./Build install22 23 19 LICENSE AND COPYRIGHT 24 25 Copyright (c) 2008 Yusuke Wada, All rights reserved.26 20 27 21 This module is free software; you can redistribute it -
lang/perl/WebService-Simple/trunk/example/flickr_echo.pl
r8681 r10275 2 2 use warnings; 3 3 use WebService::Simple; 4 use Cache::File;4 use Data::Dumper; 5 5 6 my $api_key = "your_api_key"; 7 my $cache = Cache::File->new( 8 cache_root => '/tmp/mycache', 9 default_expires => '30 min', 10 ); 6 my $api_key = $ARGV[0] || "your_api_key"; 11 7 12 8 my $flickr = WebService::Simple->new( 13 9 base_url => "http://api.flickr.com/services/rest/", 14 cache => $cache,15 10 param => { api_key => $api_key, } 16 11 ); … … 18 13 my $response = 19 14 $flickr->get( { method => "flickr.test.echo", name => "value" } ); 20 my $ref = $response->parse_ xml;21 print $ref->{name} . "\n";15 my $ref = $response->parse_response; 16 print Dumper $ref; -
lang/perl/WebService-Simple/trunk/example/flickr_search.pl
r8742 r10275 2 2 use warnings; 3 3 use WebService::Simple; 4 use YAML;4 use Data::Dumper; 5 5 use utf8; 6 6 binmode STDOUT, ":utf8"; 7 7 8 my $api_key = "your_api_key";8 my $api_key = $ARGV[0] || "your_api_key"; 9 9 10 10 my $flickr = WebService::Simple->new( … … 14 14 15 15 my $response = 16 $flickr->get( { method => "flickr.photos.search", text => " 富士山" } );17 print Dump $response->parse_xml;16 $flickr->get( { method => "flickr.photos.search", text => "cat" } ); 17 print Dumper $response->parse_response; -
lang/perl/WebService-Simple/trunk/example/lingr.pl
r10071 r10275 3 3 use WebService::Simple; 4 4 5 my $api_key ="your_api_key";6 my $room_id = "hO4SmQWTdJ4";# http://www.lingr.com/room/hO4SmQWTdJ45 my $api_key = $ARGV[0] || "your_api_key"; 6 my $room_id = "hO4SmQWTdJ4"; # http://www.lingr.com/room/hO4SmQWTdJ4 7 7 my $nickname = "lingr.pl"; 8 my $message = $ARGV[0] ||"Hello, World.";8 my $message = "Hello, World."; 9 9 10 10 my $lingr = WebService::Simple->new( … … 21 21 $response = $lingr->get( 22 22 'api/room/enter', 23 {23 { 24 24 session => $session, 25 25 id => $room_id, … … 32 32 $response = $lingr->get( 33 33 'api/room/say', 34 {34 { 35 35 session => $session, 36 36 ticket => $ticket, … … 41 41 42 42 # destroy session 43 $lingr->get( 'api/session/destroy' , { session => $session, } );43 $lingr->get( 'api/session/destroy', { session => $session, } ); -
lang/perl/WebService-Simple/trunk/lib/WebService/Simple.pm
r10211 r10275 11 11 use UNIVERSAL::require; 12 12 13 our $VERSION = '0.0 0001';13 our $VERSION = '0.03'; 14 14 15 15 __PACKAGE__->config( … … 261 261 =head1 CACHING 262 262 263 Cache the response of Web Service by using Cache object. 264 263 265 my $cache = Cache::File->new( 264 266 cache_root => '/tmp/mycache', -
lang/perl/WebService-Simple/trunk/lib/WebService/Simple/Response.pm
r10211 r10275 22 22 } 23 23 24 sub parse_xml 25 { 26 my $self = shift; 27 $self->parse_response; 28 } 29 24 30 1; 25 31
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)