Skip to content

Instantly share code, notes, and snippets.

View smaldd14's full-sized avatar

Devin Smaldore smaldd14

View GitHub Profile
@smaldd14
smaldd14 / website_location.py
Created January 22, 2025 02:44
Gather domain location info
import socket
import requests
import json
from urllib.parse import urlparse
def get_website_location(url):
"""
Determine the hosting location of a website using IP geolocation.
Args:
@smaldd14
smaldd14 / gatherApis.js
Last active December 17, 2023 19:40
Firebase cloud function that will run every saturday at midnight. The goal is to gather all of the necessary KPIs that we have logged with events in our application
const {google} = require('googleapis');
const ExcelJS = require('exceljs');
const {Storage} = require('@google-cloud/storage');
exports.scheduledFunction = functions.pubsub.schedule('0 0 * * 6').onRun(async (context) => {
// Initialize Google Analytics API
const analytics = google.analyticsreporting('v4');
// Fetch data from Google Analytics
const response = await analytics.reports.batchGet(/* ... */);