|
Revision 8742, 391 bytes
(checked in by yusukebe, 5 years ago)
|
|
lang/perl/WebService-Simple: add a flickr search example
|
| Line | |
|---|
| 1 | use strict; |
|---|
| 2 | use warnings; |
|---|
| 3 | use WebService::Simple; |
|---|
| 4 | use YAML; |
|---|
| 5 | use utf8; |
|---|
| 6 | binmode STDOUT, ":utf8"; |
|---|
| 7 | |
|---|
| 8 | my $api_key = "your_api_key"; |
|---|
| 9 | |
|---|
| 10 | my $flickr = WebService::Simple->new( |
|---|
| 11 | base_url => "http://api.flickr.com/services/rest/", |
|---|
| 12 | param => { api_key => $api_key, } |
|---|
| 13 | ); |
|---|
| 14 | |
|---|
| 15 | my $response = |
|---|
| 16 | $flickr->get( { method => "flickr.photos.search", text => "富士山" } ); |
|---|
| 17 | print Dump $response->parse_xml; |
|---|