Skip to content

Instantly share code, notes, and snippets.

@mals14
mals14 / scrapeLinkedinSearch.js
Created January 13, 2024 23:39 — forked from adrianhorning08/scrapeLinkedinSearch.js
Scrape Linkedin Search
async function scrapeLinkedinSearch() {
let allProfiles = [];
let page = 1;
window.scrollTo(0, document.body.scrollHeight);
await new Promise((resolve) => setTimeout(resolve, 500));
// find the button aria-label="Next"
let nextButton = document.querySelector('button[aria-label="Next"]');
const peeps = getProfiles();
allProfiles.push(...peeps);
@mals14
mals14 / index.js
Created January 13, 2024 23:39 — forked from adrianhorning08/index.js
Create CSV on frontend
export function createCSV(data, fileName) {
const headers = Object.keys(data[0]);
const csvContent = [
headers.join(","),
...data.map((row) =>
headers
.map((header) => {
const value = row[header];
if (value === null) return "null";
@mals14
mals14 / zillowScraper.js
Created January 13, 2024 23:38 — forked from adrianhorning08/zillowScraper.js
Zillow Scraper
async function scrollDown() {
const wrapper = document.querySelector("#search-page-list-container");
await new Promise((resolve, reject) => {
var totalHeight = 0;
var distance = 600;
var timer = setInterval(async () => {
var scrollHeightBefore = wrapper.scrollHeight;
wrapper.scrollBy(0, distance);
totalHeight += distance;
@mals14
mals14 / JXA Resources.md
Created October 15, 2021 16:00 — forked from JMichaelTX/JXA Resources.md
JavaScript for Automation (JXA) Resources

JXA Resources

Revised: 2019-11-28 16:16 GMT-6

JXA

This is a list of the key resources I have found useful. If you know of others, please post in a comment below, and I will add to this list.

I have tried to order this list in the order that, to me, is best for learning JXA from scratch. We all learn a bit diferently, so adjust to suit your style/needs. Please post if you have suggestions on learning JXA.

@mals14
mals14 / jxaClickAppSubMenuItem.applescript
Created December 2, 2020 13:42 — forked from bumaociyuan/jxaClickAppSubMenuItem.applescript
Yosemite JXA Javascript Function for clicking application sub-menu items
// Click an OS X app sub-menu item
// 2nd argument is an array of arbitrary length (exact menu item labels, giving full path)
// e.g. menuItemClick("InqScribe", ['View', 'Aspect Ratio', 'Use Media Ratio'])
// Note that the menu path (spelling & sequence) must be exactly as in the app
// See menuItemTestClick() below for a slower version which reports any errors
// For OS X 10.10 Yosemite JXA JavaScript for Automation
@mals14
mals14 / jxaClickAppSubMenuItem.applescript
Created December 2, 2020 13:40 — forked from RobTrew/jxaClickAppSubMenuItem.applescript
Yosemite JXA Javascript Function for clicking application sub-menu items
// Click an OS X app sub-menu item
// 2nd argument is an array of arbitrary length (exact menu item labels, giving full path)
// e.g. menuItemClick("InqScribe", ['View', 'Aspect Ratio', 'Use Media Ratio'])
// Note that the menu path (spelling & sequence) must be exactly as in the app
// See menuItemTestClick() below for a slower version which reports any errors
// For macOS Yosemite to Sierra
@mals14
mals14 / trello_days_left.js
Created October 10, 2019 12:56 — forked from anjiro/trello_days_left.js
Trello show days left Greasemonkey script
// ==UserScript==
// @name Trello days left
// @namespace edu.rit.ashbrook.daniel
// @include https://trello.com/*
// @version 1.1
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// @grant GM_addStyle
// @description Add the number of days left until an item is due to each applicable card.
// ==/UserScript==
@mals14
mals14 / Save mail attachments with pre-pended YYYY-MM-DD_.kmmacros
Created October 10, 2019 12:53 — forked from henryroe/Save mail attachments with pre-pended YYYY-MM-DD_.kmmacros
Keyboard Maestro macro to take Mail.app attachments, pre-pend YYYY-MM-DD_..., and save to user-selected dir
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>Activate</key>
<string>Normal</string>
<key>IsActive</key>
<true/>
<key>Macros</key>
@mals14
mals14 / index.js
Created October 10, 2019 12:53 — forked from shedali/index.js
test grab due tasks with jxa in node
const runJxa = require("run-jxa");
const _ = require('lodash');
(async () => {
const result = await runJxa(() => {
var of = Application("OmniFocus");
var doc = of.defaultDocument;
return getTasks();
@mals14
mals14 / Access NSScreen.scpt
Created October 10, 2019 12:15 — forked from henryroe/Access NSScreen.scpt
Demonstration of how to use an AppleScript Bundle to enable access to NSScreen in AppleScriptObjC
(*
Copy and paste this script into a new document in AppleScript Editor.
When saving, select "Script Bundle" as File Type.
Save the file to: "~/Library/Script Libraries/Access NSScreen.scptd"
Note: you may need to create the directory: "~/Library/Script Libraries"
Note: while this gist has the file ending "scpt", by selecting the
"Script Bundle" file type, the file extension "scptd" should be added.