Advertisement
TheMightyBuzzard

english to latin

Jun 4th, 2014
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. use LWP::UserAgent;
  4.  
  5. my $decoded;
  6. my $text = join("+", @ARGV);
  7. my $client = LWP::UserAgent->new;
  8. $client->agent('Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0');
  9. 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=");
  10. #$response = $client->responseContent();
  11. if($response->is_success)
  12. {
  13. $decoded = $response->decoded_content;
  14. }
  15. $decoded =~ /<span id=result_box class="short_text"><span.*?>(.*?)<\/span>/;
  16. print $1,"\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement