google translate API error undefined - google-translate

I have written a sample nodejs code to consume google translate API. For last 2-3 days I am getting undefined error intermittently. If I run this sample code multiple times, randomly few times I am getting the error. not sure if I am doing something wrong here or the service is experiencing some issues.
Please help, thanks in advance.
var googleTranslate = require('google-translate')
('XXXXXXXXXXXXXXXX');
googleTranslate.translate(['Hello', 'Thank you'], 'en', 'de',
function(err, translations) {
console.log(translations);
});

Check your API_KEY , I faced with this problem before and my api key was wrong

Related

Here-API can not find normal.day.yaml

I have been experimenting with here maps. When I started the project I was minimising the project code and everything was working as expected.
However, in order to debug the project I stopped minimising the code. Now when loading here maps I get a 404 trying to load:
http://localhost:8082/vendor/here-maps//styles/omv/miami/normal.day.yaml
I have looked back at my code that was working, (when I was minimising the code) and the url was:
https://js.api.here.com/v3/3.1.17.2/styles/omv/miami/normal.day.yaml
Why has the url changed when I stopped minimising the code?
How do I correct the issue?
Thanks in advance.
I think it is here bugs? I only get 3 working, and others when request tile.png get error 404
var here_apiKey = '....'
var appId = 'xxx';
var appCode = '......';
var urlTpl =
'https://{1-4}.{base}.maps.cit.api.here.com' +
'/{type}/2.1/maptile/newest/{scheme}/{z}/{x}/{y}/256/png' +
'?app_id={app_id}&app_code={app_code}' +
'&apiKey={api_key}';
I can get these working :
satellite.day
hybrid.day
terrain.day
But when request tile.png get error 404 on these:
pedestrian.day
normal.day.transit
normal.day

Firebase Analytics preventing proper use of dynamic link

I'm running in trouble here with Firebase.
The code is in flutter, I am testing in iOS
It's all going well, but when I try to get the dynamic link sent from:
auth.sendSignInWithEmailLink(parameters);
I get a debug message:
[Firebase/Analytics][I-ACS023001] Deep Link does not contain valid required params. URL params: {
amv = 16;
apn = "com.myproject.app";
ibi = "com.myproject.app";
ifl = "https://myproject-com.firebaseapp.com/__/auth/action?apiKey=XXXXXXXXXXX&mode=signIn&oobCode=XXXXXX&continueUrl=https://myproject-com.firebaseapp.com/email123&lang=en";
link = "https://myproject-com.firebaseapp.com/__/auth/action?apiKey=XXXXXXX&mode=signIn&oobCode=XXXXXX&continueUrl=https://myproject-com.firebaseapp.com/email123&lang=en";
}
where I changed my project name to "myproject" and put XXX inplace of apiKey/oobcode
and then, when I try to get the dynamic link with my app
final PendingDynamicLinkData data = await FirebaseDynamicLinks.instance.getInitialLink();
data is null.
So I am guessing Firebase Analytics is processing it and "killing" the dynamic link before my app can parse it.
Anyone managed to go through this?
I found the problem.
It is not that Firebase Analytics was "consuming" and killing the deep link.
The thing is that in iOS still today there is a delay the link and the state cycle...
https://medium.com/#diegoveloper/flutter-firebase-dynamic-link-6f1b79278ce0
This link explains it, problem 2 in the blog post.
Solved. I can still use analytics in Firebase.
It is impossible to remove analytics btw, you can only disable it.

Why the Google Analytics API is eating the "\" in my filter query?

I am playing with Google Analytics API and found it very interesting. But today I came with a problem that can't be solved.
I am sending a filter like this:
'filters':'ga:pagePath=~^/q-\d+/\d+$'
It's working good in the Query Explorer but not working with my code.
After some tests I found that the query is wrong when it's sent. Here is from the "Network" panel of my Chrome debugging tool:
As in the picture, the \d became d and I guess that is the reason the data is not correctly showing up.
How can I fix this?
Here is my code:
var o ={
'ids': 'ga:' + profileId,
'start-date': $('#startdate').val(),
'end-date': $('#enddate').val(),
'metrics': 'ga:pageviews,ga:uniquePageviews',
'dimensions': 'ga:pagePath',
'sort':'ga:pagePath',
'filters':'ga:pagePath=~^/q-\d+/\d+$'
};
gapi.client.analytics.data.ga.get(o)
.then(function(response) {
Thanks,
You need to escape backslash symbols:
'filters':'ga:pagePath=~^/q-\\d+/\\d+$'
This this can be easily checked:
console.log('ga:pagePath=~^/q-\\d+/\\d+$');
console.log('ga:pagePath=~^/q-\d+/\d+$');
If you are using custom events in GA probably you can take a look at http://mixpanel.com or http://www.devmetrics.io, they provide better event model and event oriented API / UI.

OpenSocial API stopped working in Google Calendar Gadget

I found out that opensocial API we were using in Calendar Sidebar Gadget stopped working. It was still working correctly on Friday. We were using opensocial to store and get some key-value data, and today we are getting error code: badRequest (with no error message) everytime we are trying to read anything.
This an example of the code we are using:
var idspec = opensocial.newIdSpec({ "userId" : "VIEWER", "groupId" : "SELF" });
var req = opensocial.newDataRequest();
req.add(req.newFetchPersonAppDataRequest(idspec, "mydata"), "get_data");
req.send(function(data){console.log(data)});
And this is the response we are getting from google:
errorMessage_: undefined
globalError_: true
responseItems_: Object
get_data: opensocial.ResponseItem
data_: null
errorCode_: "badRequest"
errorMessage_: undefined
The code is quite simillar to what is described here: http://docs.opensocial.org/display/OSREF/App+Data
Does anyone have some similar problem, or know how to fix it? We are using it on our production system which is down since morning. any help would be appreciated.
The API has been deprecated. For solving this i changed the implementation for importing Google Contacts with Google oAuth 2.0 and its working fine with it.
https://developers.google.com/igoogle/docs/opensocial_rest_rpc ( deprecated one ).
For using Google oAuth 2.0 visit below link :-
https://developers.google.com/accounts/docs/OAuth2Login

fetching all the Restaurants, supermarkets, malls etc. nearby using the Google Maps Api

I'm new in iPhone Development. I'm creating an application in which i need to fetch all the Restaurents, supermarkets, malls etc. in the nearby location using GoogleApi. Im using following link to find the venue:
https://maps.googleapis.com/maps/api/place/search/json?location=-33.8670522,151.1957362&radius=500&types=grocery_or_supermarket&sensor=true&key=AIzaSyAiFpFd85eMtfbvmVNEYuNds5TEF9FjIPI
But I'm getting the following message:
"html_attributions" : [],
"results" : [],
"status" : "REQUEST_DENIED"
Please help.
Any solution will be appreciated.
Thanks in advance.
"Access denied" is coming because the key(AIzaSyAiFpFd85eMtfbvmVNEYuNds5TEF9FjIPI) you are using is not valid.
You have to register your project on on Google and have to generate unique key from this link.replace the generated key with the key in your link, then this will work fine.
If you have any other query let me know.

Resources