summary refs log tree commit diff
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-10-17 21:40:28 +0200
committerfranck cuny <franck@lumberjaph.net>2010-10-17 21:40:28 +0200
commitdba1ee2b1252ad4ef8a64622daf6c2dd5ddb2557 (patch)
tree1205fdabbbfa45c25cab88d464eca1becec9e9c7
parentupdate version and changes (diff)
downloadnet-http-spore-dba1ee2b1252ad4ef8a64622daf6c2dd5ddb2557.tar.gz
simplify github example
-rw-r--r--eg/api.pl15
1 files changed, 2 insertions, 13 deletions
diff --git a/eg/api.pl b/eg/api.pl
index 4e89701..9fd3bee 100644
--- a/eg/api.pl
+++ b/eg/api.pl
@@ -4,21 +4,10 @@ use 5.010;
 
 use Net::HTTP::Spore;
 
-my $username = shift;
-my $token = shift;
-
 my $api = Net::HTTP::Spore->new_from_spec(shift);
 
 $api->enable('Net::HTTP::Spore::Middleware::Format::JSON');
 
-$api->enable(
-    'Net::HTTP::Spore::Middleware::Auth::Basic',
-    username => $username,
-    password => $token,
-);
-
-my ( $content, $result ) =
-  $api->user_information( format => 'json', username => 'franckcuny' );
+my ( $content, $result ) = $api->user_information( format => 'json', username => 'franckcuny' );
 
-use YAML::Syck;
-warn Dump $content;
+say "name => ". $content->{body}->{user}->{name};