Skip to content

Instantly share code, notes, and snippets.

@2shortplanks
Created February 18, 2011 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 2shortplanks/062e5d81493dd3955f75 to your computer and use it in GitHub Desktop.
Save 2shortplanks/062e5d81493dd3955f75 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use strict;
use warnings;
use Mojo::Client;
my $client = Mojo::Client->new;
my $url = Mojo::URL->new("https://www.googleapis.com/language/translate/v2")->query(
key => 'AIzaSyAVlesUTcrwoEKw9fZ_LzPm6aERyLvm39E',
q => scalar do { local $/; <> },
target => "fr",
);
my $response = $client->get($url)->res;
use Data::Dumper;
print STDERR Data::Dumper->Dump([ $response ],[split /,\s*/,q[$response]]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment