swalker-888 / google-indexing-api-bulk Goto Github PK
View Code? Open in Web Editor NEWSubmit URLs in bulk to Google's Indexing API using a batch request
Submit URLs in bulk to Google's Indexing API using a batch request
Hi
not work!
error below:
Hi, when i tried to run de index.js i got this error.
c:\google-indexing-api-bulk-master>node index.js
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module 'request'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (c:\google-indexing-api-bulk-master\google-indexing-api-bulk-master\index.js:3:15)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
HELP ME. I'M NOT GOOD AT PROGRAMMING BUT THERE'S AN ERROR IN THE CODE.
Terminal:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\user\Desktop\Bulk Google Indexer\google-indexing-api-bulk-master>node index.js
internal/modules/cjs/loader.js:968
throw err;
^
Error: Cannot find module 'request'
Require stack:
C:\Users\user\Desktop\Bulk Google Indexer\google-indexing-api-bulk-master>
Via another application I have a working keyset and I am not able to figure out - when using the code - this error keeps popping up.
c:\google-indexing-api-bulk-master>node index.js
Error: No key or keyFile set.
at GoogleToken.getTokenAsync (c:\google-indexing-api-bulk-master\node_modules\gtoken\build\src\index.js:125:19)
at GoogleToken.getToken (c:\google-indexing-api-bulk-master\node_modules\gtoken\build\src\index.js:77:21)
at JWT.refreshTokenNoCache (c:\google-indexing-api-bulk-master\node_modules\google-auth-library\build\src\auth\jwtclient.js:134:36)
at JWT.refreshToken (c:\google-indexing-api-bulk-master\node_modules\google-auth-library\build\src\auth\oauth2client.js:142:25)
at JWT.authorizeAsync (c:\google-indexing-api-bulk-master\node_modules\google-auth-library\build\src\auth\jwtclient.js:117:35)
at JWT.authorize (c:\google-indexing-api-bulk-master\node_modules\google-auth-library\build\src\auth\jwtclient.js:110:18)
at Object. (c:\google-indexing-api-bulk-master\index.js:19:11)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
It seems to be correct, but the query gives out a huge errors
GaxiosError: invalid_grant: Invalid JWT: Token must be a short-lived token (60 minutes) and in a reasonable timeframe. Check your iat and exp values in the JWT claim. at Gaxios._request (C:\Users\trust\Desktop\google-indexing-api-bulk-master\node_modules\gaxios\build\src\gaxios.js:129:23) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async GoogleToken.requestToken (C:\Users\trust\Desktop\google-indexing-api-bulk-master\node_modules\gtoken\build\src\index.js:231:23) at async GoogleToken.getTokenAsync (C:\Users\trust\Desktop\google-indexing-api-bulk-master\node_modules\gtoken\build\src\index.js:142:20) at async JWT.refreshTokenNoCache (C:\Users\trust\Desktop\google-indexing-api-bulk-master\node_modules\google-auth-library\build\src\auth\jwtclient.js:171:23) at async JWT.authorizeAsync (C:\Users\trust\Desktop\google-indexing-api-bulk-master\node_modules\google-auth-library\build\src\auth\jwtclient.js:152:24) { response: { config: { method: 'POST', url: 'https://www.googleapis.com/oauth2/v4/token', data: [Object], headers: [Object], responseType: 'json', paramsSerializer: [Function: paramsSerializer], body: 'grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJ0YWtldG9uZXMtNDc0QHRha2V0b25lcy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInNjb3BlIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vYXV0aC9pbmRleGluZyIsImF1ZCI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL29hdXRoMi92NC90b2tlbiIsImV4cCI6MTY0ODgyMDc4MywiaWF0IjoxNjQ4ODE3MTgzLCJzdWIiOm51bGx9.MV7GFkye0QZnJb5GC8uWX_BrCpxQxIajH5vsLLseGsFwNJhL0LTtuGPykAASiVHFyLDRUUCsC-B7pdl_AvsQkXyokTP-OPYUCwW7FNaib-1wQvywBqXeQhV2WvJnj-YTvOlv7_TSzmpkd_6X1jd_L-CRQcGBaQmQNFjNiWfvcQ7dxNP0T_Xeq0Bfhy5goD121ndjn2yrrc_sCJRSu685GAXHE2ovIjDv42RRm657pCCD9RkseC2xAV0O6-4JGrqNPNt5hD7ACYaDWkULUeXYqP40wrNTg4ak1-gd--WoDbM24H88zWRcwxOXAzdL7yCIF8-eIN9goAlO_Cu4vhgj7w', validateStatus: [Function: validateStatus] }, data: { error: 'invalid_grant', error_description: 'Invalid JWT: Token must be a short-lived token (60 minutes) and in a reasonable timeframe. Check your iat and exp values in the JWT claim.' }, headers: { 'alt-svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"', 'cache-control': 'private', connection: 'close', 'content-encoding': 'gzip', 'content-type': 'application/json; charset=UTF-8', date: 'Fri, 01 Apr 2022 11:46:23 GMT', server: 'scaffolding on HTTPServer2', 'transfer-encoding': 'chunked', vary: 'Origin, X-Origin, Referer', 'x-content-type-options': 'nosniff', 'x-frame-options': 'SAMEORIGIN', 'x-xss-protection': '0' }, status: 400, statusText: 'Bad Request', request: { responseURL: 'https://www.googleapis.com/oauth2/v4/token' } }, config: { method: 'POST', url: 'https://www.googleapis.com/oauth2/v4/token', data: { grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer', assertion: 'eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJ0YWtldG9uZXMtNDc0QHRha2V0b25lcy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInNjb3BlIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vYXV0aC9pbmRleGluZyIsImF1ZCI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL29hdXRoMi92NC90b2tlbiIsImV4cCI6MTY0ODgyMDc4MywiaWF0IjoxNjQ4ODE3MTgzLCJzdWIiOm51bGx9.MV7GFkye0QZnJb5GC8uWX_BrCpxQxIajH5vsLLseGsFwNJhL0LTtuGPykAASiVHFyLDRUUCsC-B7pdl_AvsQkXyokTP-OPYUCwW7FNaib-1wQvywBqXeQhV2WvJnj-YTvOlv7_TSzmpkd_6X1jd_L-CRQcGBaQmQNFjNiWfvcQ7dxNP0T_Xeq0Bfhy5goD121ndjn2yrrc_sCJRSu685GAXHE2ovIjDv42RRm657pCCD9RkseC2xAV0O6-4JGrqNPNt5hD7ACYaDWkULUeXYqP40wrNTg4ak1-gd--WoDbM24H88zWRcwxOXAzdL7yCIF8-eIN9goAlO_Cu4vhgj7w' }, headers: { 'Content-Type': 'application/x-www-form-urlencoded', Accept: 'application/json' }, responseType: 'json', paramsSerializer: [Function: paramsSerializer], body: 'grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJ0YWtldG9uZXMtNDc0QHRha2V0b25lcy5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInNjb3BlIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vYXV0aC9pbmRleGluZyIsImF1ZCI6Imh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL29hdXRoMi92NC90b2tlbiIsImV4cCI6MTY0ODgyMDc4MywiaWF0IjoxNjQ4ODE3MTgzLCJzdWIiOm51bGx9.MV7GFkye0QZnJb5GC8uWX_BrCpxQxIajH5vsLLseGsFwNJhL0LTtuGPykAASiVHFyLDRUUCsC-B7pdl_AvsQkXyokTP-OPYUCwW7FNaib-1wQvywBqXeQhV2WvJnj-YTvOlv7_TSzmpkd_6X1jd_L-CRQcGBaQmQNFjNiWfvcQ7dxNP0T_Xeq0Bfhy5goD121ndjn2yrrc_sCJRSu685GAXHE2ovIjDv42RRm657pCCD9RkseC2xAV0O6-4JGrqNPNt5hD7ACYaDWkULUeXYqP40wrNTg4ak1-gd--WoDbM24H88zWRcwxOXAzdL7yCIF8-eIN9goAlO_Cu4vhgj7w', validateStatus: [Function: validateStatus] }, code: '400' }
Hi!
Could you push a working example of urls.txt file?
I tried to put this format i.e:
https://canonicaldomain.com
https://canonicaldomain.com/url1
https://canonicaldomain.com/url2
https://canonicaldomain.com/url3
but I got this error:
--batch_bxcXt4TswdrogJK9TDNfl1ZzywnLgbL-
Content-Type: application/http
Content-ID: response-
HTTP/1.1 400 Bad Request
Vary: Origin
Vary: X-Origin
Vary: Referer
Content-Type: application/json; charset=UTF-8
{
"error": {
"code": 400,
"message": "Missing attribute. 'url' attribute is required.",
"status": "INVALID_ARGUMENT"
}
}
--batch_bxcXt4TswdrogJK9TDNfl1ZzywnLgbL---
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.