Skip to content

Instantly share code, notes, and snippets.

View redfin_scraper.js
// what is AVM?
const sleep = (n) => new Promise((resolve) => setTimeout(resolve, n));
async function getAboveTheFold(propertyId) {
const r = await fetch(`https://www.redfin.com/stingray/api/home/details/aboveTheFold?propertyId=${propertyId}&accessLevel=1`);
const t = await r.text();
const data = JSON.parse(t.replace('{}&&', ''));
const payload = data.payload;
const addressSectionInfo = payload.addressSectionInfo;
View screencap.js
async function screenCap(duration) {
function _startScreenCapture() {
if (navigator.getDisplayMedia) {
return navigator.getDisplayMedia({video: true});
} else {
return navigator.mediaDevices.getUserMedia({video: {mediaSource: 'screen'}});
}
}
const stream = await _startScreenCapture();