Skip to content

Instantly share code, notes, and snippets.

View WeaverAndrew55's full-sized avatar

WeaverAndrew55

View GitHub Profile
This file has been truncated, but you can view the full file.
[
{
"url": "https://www.burgessyachts.com/en/buy-a-yacht/yachts-for-sale",
"crawl": {
"loadedUrl": "https://www.burgessyachts.com/en/buy-a-yacht/yachts-for-sale",
"loadedTime": "2025-08-31T10:21:27.737Z",
"referrerUrl": "https://www.burgessyachts.com/en/buy-a-yacht/yachts-for-sale",
"depth": 0,
"httpStatusCode": 200
// ----- Code.gs -----
/**
* @OnlyCurrentDoc Limits the script to only accessing the current spreadsheet.
*/
// ============================================================================
// MENU & UI FUNCTIONS
// ============================================================================
// ----- Code.gs -----
/**
* @OnlyCurrentDoc Limits the script to only accessing the current spreadsheet.
*/
// ============================================================================
// MENU & UI FUNCTIONS
// ============================================================================
/**
* Handles interactions with the Apify API for starting runs, polling status, and fetching results.
* Uses UrlFetchApp for HTTP requests and time-driven triggers for polling.
*/
const ApifyService = (function() {
const API_BASE_URL = 'https://api.apify.com/v2';
// Default polling interval - can be overridden by Settings
const DEFAULT_POLLING_INTERVAL_SECONDS = 10; // [cite: 99]
// Limit total polling time to avoid orphaned triggers (e.g., slightly less than 60 mins)
const MAX_POLLING_DURATION_MINUTES = 55;
// === Content for PolygonDataT2.gs ===
const POLYGON_DATA_T2A = {
"type": "Polygon",
"coordinates": [
[
[
-113.920945193699,
51.038218149215
],
/**
* Manages retrieval of FSA polygon data.
* !! IMPORTANT !! This version assumes polygon data is stored as global constants
* (e.g., POLYGON_DATA_T1A, POLYGON_DATA_T2B) defined in separate .gs files
* (e.g., PolygonDataT1.gs, PolygonDataT2.gs, PolygonDataT3.gs)
* within the Apps Script project. It does NOT read JSON from the 'Polygons' sheet.
*/
const PolygonManager = (function() {
// Sheet needed only to get the list of FSAs initially, not for data storage.
const POLYGON_SHEET_NAME = 'Polygons';