Skip to content

Instantly share code, notes, and snippets.

View darinalleman's full-sized avatar

Darin Alleman darinalleman

View GitHub Profile
@darinalleman
darinalleman / Code.gs
Last active December 20, 2023 07:23
Zillow Tiller Sheets Importer (With Balance History)
function writeZestimateToSheet() {
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var sheets = spreadsheet.getSheets();
var zillowSheet = sheets.find(sheet => sheet.getSheetName() == 'Zillow');
var balanceHistory = sheets.find(sheet => sheet.getSheetName() == 'Balance History');
if (zillowSheet && balanceHistory) {
var zillowIds = ['%%%%%%%%%'];
var row = [];
for (i = 0; i < zillowIds.length; i++) {
if (zillowIds[i] != undefined){
@darinalleman
darinalleman / Code.gs
Last active March 30, 2024 20:29
Google Sheets Zillow Import Script
function writeZestimateToSheet() {
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var sheets = spreadsheet.getSheets();
var zillowSheet = sheets.find(sheet => sheet.getSheetName() == 'Zillow');
if (zillowSheet) {
var html = UrlFetchApp.fetch('https://www.zillow.com/homes/%%%%%%%%%_zpid/').getContentText();
const divRegex = /(<div class="zestimate-value">)(\$)(\d{1,3})(,\d{3})*(<\/div>)/g;
const moneyRegex = /(\$)(\d{1,3})(,\d{3})*/g;
var div = html.match(divRegex);
function isDope(object) {
return object.tagName === 'BUTTON';
}
var arr = Array.from(document.getElementsByClassName('thumbs-up '));
var button = arr.find(isDope);
setInterval(function() {
button.click();
console.log('clicked!');
}, 20000);