mzubairsaleem / gtranslate-api-php

Automatically exported from code.google.com/p/gtranslate-api-php
GNU General Public License v3.0
0 stars 0 forks source link

GTranslateException: [0]: Unable to perform Translation:Suspected Terms of Service Abuse. Please see http://code.google.com/apis/errors #27

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
After about 150 requested translations it stops throwing the error i showed in 
the title, the requests are done under 60 seconds (the whole 150);

I run this php scrip as cli script 

this is the method that i run:

public function TranslateDetails(){
        $get=$this->conn->select("select `details`.*,`summary`.`id` 'sum_id' from `summary`,`details` where `summary`.`id`=`details`.`summary_id` and `summary`.`details_translated`=0");

        if(sizeof($get)>0)
        foreach($get as $each) {

            if($each['text']=="")
                continue;

            try {
            $text=$this->Translate($each['text']);
            } catch (GTranslateException $e){
                echo $e;
                die("Stoped");
            }

            $this->conn->update("update `details` set `text`='".$text."' where `id`=".$each['id']);
            $this->conn->update("update `summary` set `details_translated`=1 where `id`=".$each['sum_id']);
            echo  date("H:i:s"),"\t","Translated Details: ",$each['id'],PHP_EOL;
        }
    }

My questions is if this has some limitations on how many requests can i do per 
second, or per minute. 

Thanks

Original issue reported on code.google.com by balanali...@gmail.com on 25 Aug 2010 at 8:18

GoogleCodeExporter commented 8 years ago

Original comment by josedasilva on 26 Nov 2010 at 4:20

GoogleCodeExporter commented 8 years ago
I have the same problem,but the strange thing is after I translate several 
days(about 5 days),I can't translate it any more,what happened?

Original comment by wublue1234@gmail.com on 22 Dec 2010 at 2:31