I am using this small piece of code to access Googles translation engine:
This code works pretty fine for me but from time to time this code stops working. In the debug window I can see that Google starts blocking my IP address telling me that " systems have detected unusual traffic from your computer network". I know that polling to fast results in blocking by Google. So, I have included a timer (20 sec) to my code to avoid fast polling. Nevertheless, after days and sometimes after hours Goggle is blocking me again. Is there any way how I can refuse this behaviour by code or configuration. After resetting my router everything works fine again.
B4X:
job.Initialize("", Me)
poststr = GOOGLE_LNG & procs.SRCLANG & "&tl=" & procs.DSTLANG & "&dt=t&q=" & spoken
job.PostString(poststr, "")
job.GetRequest.SetHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0")
Wait For (job) JobDone(j As HttpJob)
If j.Success Then
'translation successful
trans = job.GetString
'get translation out of JSON formatted string
trans = procs.ParseJson(trans)
End If
This code works pretty fine for me but from time to time this code stops working. In the debug window I can see that Google starts blocking my IP address telling me that " systems have detected unusual traffic from your computer network". I know that polling to fast results in blocking by Google. So, I have included a timer (20 sec) to my code to avoid fast polling. Nevertheless, after days and sometimes after hours Goggle is blocking me again. Is there any way how I can refuse this behaviour by code or configuration. After resetting my router everything works fine again.