This file contains hidden or 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
javascript:(function() { | |
try { | |
// Check if window.getSelection() is available | |
var selection = window.getSelection ? window.getSelection().toString().trim() : ''; | |
// Double check to ensure we have access to the current URL | |
var currentUrl = window.location.href ? window.location.href : 'URL unavailable'; | |
// Construct the message based on the selection or lack thereof | |
var message = selection || `Fetch content from ${currentUrl} for context. Please wait for further instructions.`; | |
var baseMessage = `I copied this content:\n\n>>>\n"${message}"\n>>>\n\nFrom this URL: ${currentUrl}\nFetch this URL for more context.\n\nPlease wait for further instructions.`; |
This file contains hidden or 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 runAnalyses() { | |
createLineChartWithQuartiles('Queries'); | |
createLineChartWithQuartiles('Pages'); | |
createLineChartWithQuartiles('Countries'); | |
createLineChartWithQuartiles('Devices'); | |
createLineChartWithQuartiles('Dates'); | |
} | |
function createLineChartWithQuartiles(sheetName) { | |
var sheet = SpreadsheetApp.getActive().getSheetByName(sheetName); |
This file contains hidden or 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 axios = require('axios'); | |
const cheerio = require('cheerio'); | |
const argv = require('yargs').argv; | |
const sleep = require('util').promisify(setTimeout); | |
const start_url = argv._[0] || ''; | |
const delay = argv.s || 1; | |
const headers = { | |
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3', |
This file contains hidden or 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 analyzeURLs() { | |
const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); | |
const data = sheet.getDataRange().getValues(); | |
deleteSheets(['Page Type Analysis', 'Language Namespace Analysis', 'Parameters Analysis', 'Copied & Analyzed']); | |
// Create a copy of the original sheet | |
const newSheet = sheet.copyTo(SpreadsheetApp.getActiveSpreadsheet()); | |
newSheet.setName('Copied & Analyzed'); |
This file contains hidden or 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 calculateAndCreatePieChart() { | |
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = spreadsheet.getSheetByName('Queries'); | |
var chartSheetName = 'brand'; | |
var brandstring = "radar"; | |
// Remove old chart sheet if exists | |
var oldChartSheet = spreadsheet.getSheetByName(chartSheetName); | |
if (oldChartSheet) spreadsheet.deleteSheet(oldChartSheet); |
This file contains hidden or 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
// Global spreadsheet object | |
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); | |
//console.log(spreadsheet); | |
function main() { | |
console.log("main"); | |
generateLineCharts(); | |
} | |
// Function to delete multiple sheets |
This file contains hidden or 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 generateCharts() { | |
// Access the sheet | |
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Devices'); | |
// Sort Column A | |
sheet.getRange('A2:E4').sort(1); | |
// Get the range for your data | |
var dataRange = sheet.getRange('A1:E4'); |
This file contains hidden or 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 analyzeURLs() { | |
const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); | |
const data = sheet.getDataRange().getValues(); | |
deleteSheets(['Page Type Analysis', 'Language Namespace Analysis', 'Parameters Analysis', 'Copied & Analyzed']); | |
// Create a copy of the original sheet | |
const newSheet = sheet.copyTo(SpreadsheetApp.getActiveSpreadsheet()); | |
newSheet.setName('Copied & Analyzed'); |
This file contains hidden or 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 createChart() { | |
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); | |
// Get the last row with content | |
var lastRow = sheet.getLastRow(); | |
// Get data range | |
var dataRange = sheet.getRange('A2:B' + lastRow); | |
var data = dataRange.getValues(); |
This file contains hidden or 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
{ | |
"exportFormatVersion": 2, | |
"exportTime": "2020-10-06 15:31:33", | |
"containerVersion": { | |
"path": "accounts/6000775609/containers/32949204/versions/0", | |
"accountId": "6000775609", | |
"containerId": "32949204", | |
"containerVersionId": "0", | |
"container": { | |
"path": "accounts/6000775609/containers/32949204", |
NewerOlder