Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use LWP::UserAgent;
- my $decoded;
- my $text = join("+", @ARGV);
- my $client = LWP::UserAgent->new;
- $client->agent('Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0');
- my $response = $client->get("https://translate.google.com/?sl=en&tl=la&js=n&prev=_t&hl=en&ie=UTF-8&text=$text&file=&edit-text=");
- #$response = $client->responseContent();
- if($response->is_success)
- {
- $decoded = $response->decoded_content;
- }
- $decoded =~ /<span id=result_box class="short_text"><span.*?>(.*?)<\/span>/;
- print $1,"\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement