This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bower install pdfmake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generateGoogleToken() { | |
// This will prompt a dialogue to allow cGOA access to see drive | |
DriveApp.getFileById(‘YOUR_FILE_ID’) | |
var propertyStore = PropertiesService.getScriptProperties(); | |
// service account for play console | |
cGoa.GoaApp.setPackage (propertyStore , | |
cGoa.GoaApp.createServiceAccount (DriveApp, { | |
packageName: 'PlayConsole', | |
fileId:‘YOUR_FILE_ID’, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* namespace to deal with oauth | |
* @namespace Oauth | |
*/ | |
var Goth = (function(ns) { | |
/** | |
* get a goa or fail | |
* @param {string} packageName the package name | |
* @param {PropertiesService} [props=ScriptProperties] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getLatestReviews() { | |
var token = Goth.getToken('PlayConsole') | |
var response = UrlFetchApp.fetch("https://www.googleapis.com/androidpublisher/v3/applications/your_package_name/reviews?access_token=your_auth_token"); | |
// Parse the JSON reply | |
var json = response.getContentText(); | |
var data = JSON.parse(json); | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = ss.getActiveSheet(); | |
var reviews = data["reviews"].reverse() | |
var lastRow = sheet.getLastRow(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getColByName(name){ | |
var headers = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet1').getDataRange().getValues()[1]; | |
var colindex = headers.indexOf(name); | |
return colindex+1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var response = UrlFetchApp.fetch("https://www.googleapis.com/androidpublisher/v3/applications/your_package_name/reviews?access_token=your_auth_token"); | |
// Parse the JSON reply | |
var json = response.getContentText(); | |
var data = JSON.parse(json); | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = ss.getActiveSheet(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UrlFetchApp.fetch("https://www.googleapis.com/androidpublisher/v3/applications/your_package_name/reviews?access_token=your_auth_token"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { KeyManagementServiceClient } = require('@google-cloud/kms'); | |
const projectId = <YourProjectID>; | |
const locationId = <YourPreferedStorageLocationID>; //Based on the google cloud regions e.g. us-central1 | |
const keyRingId = <KeyRingID>; | |
const kmsClient = new KeyManagementServiceClient(); | |
const locationName = kmsClient.locationPath(projectId, locationId); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const projectId = <YourProjectID>; | |
const locationId = <YourPreferedStorageLocationID>; //Based on the google cloud regions e.g. us-central1 | |
const keyRingId = <KeyRingID>; | |
const kmsClient = new KeyManagementServiceClient(); | |
const locationName = kmsClient.locationPath(projectId, locationId); | |
async function createKeySymmetricEncryptDecrypt() { | |
const keyRingName = await kmsClient.keyRingPath(projectId, locationId, keyRingId); |
OlderNewer