achiever07 / micrsoft-translator-php-wrapper

Automatically exported from code.google.com/p/micrsoft-translator-php-wrapper
0 stars 0 forks source link

HTTP/1.1 403 Forbidden on OVH.com #6

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I got this error :

Warning: 
file_get_contents(https://api.datamarket.azure.com/Data.ashx/Bing/MicrosoftTrans
lator/v1/Translate?Text=%27Hello%27&To=%27fr%27&$format=Raw&$top=100) 
[function.file-get-contents]: failed to open stream: HTTP request failed! 
HTTP/1.1 403 Forbidden in 
/homez.29/fonctions/translate/class/MicrosoftTranslator.class.php on line 140
{"status":"ERROR","errorReason":"There is some un expected error . please check 
the code"}

I try 2 different keys.

Original issue reported on code.google.com by delaf...@gmail.com on 20 Mar 2013 at 3:11

GoogleCodeExporter commented 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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
Same error if I try with index.php. See attachment

Original comment by stefano....@gmail.com on 5 Jun 2013 at 6:50

Attachments:

GoogleCodeExporter commented 8 years ago
Solved! I was not subscribed to the application!

Original comment by stefano....@gmail.com on 5 Jun 2013 at 7:12