Open GoogleCodeExporter opened 8 years ago
can i see the code please? please mail me
Original comment by renji....@gmail.com
on 18 May 2013 at 5:24
I have downloaded from
svn checkout http://micrsoft-translator-php-wrapper.googlecode.com/svn/trunk/
micrsoft-translator-php-wrapper-read-only
added my key in config.inc.php
Mofified translator.php in this way:
<?php
/**
* This file will retuen JSON response
*/
require_once('config.inc.php');
require_once('class/ServicesJSON.class.php');
require_once('class/MicrosoftTranslator.class.php');
$translator = new MicrosoftTranslator(ACCOUNT_KEY);
$text_to_translate = $argv[1];
$to = "en";
$from = "it";
$translator->translate($from, $to, $text_to_translate);
echo $translator->response->jsonResponse;
And ran the following from command line:
>php translator2.php hello
X-Powered-By: PHP/5.2.10-2ubuntu6.10
Content-type: text/html
<br />
Warning:
file_get_contents(https://api.datamarket.azure.com/Data.ashx/Bing/MicrosoftTrans
lator/v1/Translate?Text=%27hello%27&To=%27en%27&$format=Raw&$top=100) [<a
href='function.file-get-contents'>function.file-get-contents</a>]: failed to
open stream: HTTP request failed! HTTP/1.1 403 Forbidden
in /tmp/temp/micrsoft-translator-php-wrapper-read-only/class/MicrosoftTranslator.class.php on line 140<br />
{"status":"ERROR","errorReason":"There is some un expected error . please check
the code"}
Perhaps, I Cannot run from command line?
Thanks in advance.
Original comment by stefano....@gmail.com
on 5 Jun 2013 at 6:33
Same error if I try with index.php. See attachment
Original comment by stefano....@gmail.com
on 5 Jun 2013 at 6:50
Attachments:
Solved! I was not subscribed to the application!
Original comment by stefano....@gmail.com
on 5 Jun 2013 at 7:12
Original issue reported on code.google.com by
delaf...@gmail.com
on 20 Mar 2013 at 3:11