This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rows = document.querySelectorAll('.tk-list-item-wrapper'); | |
csvData = []; | |
rows.forEach(row => { | |
texts = Array.from(row.querySelectorAll('[data-toolkit-component="Text"]')) | |
.map(element => { | |
let text = element.textContent.trim(); | |
// Check if text matches "completed DD/MM/YYYY" and extract the date | |
let match = text.match(/completed (\d{2}\/\d{2}\/\d{4})/); | |
return match ? `"${match[1]}"` : `"${text}"`; // Add quotes for CSV format |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require('axios'); | |
const data = { | |
"count_only": false, | |
"limit": 100, | |
"export": "caller", // returns JSON | |
"fields": ["job_name", "department", "hours", "seniority", "remote", "company_name", "company_url", "post_url_https", "board_url", "tags_matched", "tag_categories", "categories", "company_categories", "job_location", "city", "region", "country", "addresses", "comp_est", "comp_range", "language", "twitter_url", "linkedin_url", "github_url", "logo_url", "contact_url", "about_url", "author", "emails", "last_indexed", "job_published_at", "post_html", "company_description", "alexa_rank", "domcop_rank"], | |
"filters": [ | |
{"field": "categories", "operator": "CONTAINS_ANY", "value": ["Graphic Design", "Logo Design"]}, | |
{"field": "country", "operator": "IS_IN", "value": ['United States', 'Canada']}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
import os | |
## Option 1 - query the companies dataset, pull pre-aggregated data | |
response = requests.get( | |
"https://sourcestack-api.com/companies?url=Copy.ai&fields=open_job_names,open_job_tech_use", | |
headers={"X-API-KEY": os.environ["SOURCESTACK_KEY"]} | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Adds a menu on user opening the spreadsheet | |
function onOpen() { | |
options = [ | |
{name:"Move Rows", functionName:"moveRows"}, | |
]; | |
SpreadsheetApp.getActiveSpreadsheet().addMenu("~ Tools ~ ", options); | |
} | |
function moveRows() { | |
var sheet = SpreadsheetApp.getActiveSpreadsheet(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function fetch_jobs() { | |
$api_key = getenv("SOURCESTACK_KEY"); | |
$data = array( | |
"export" => "caller", | |
"limit" => 100, | |
"fields" => ["post_url", "company_url", "job_name", "company_name", "job_location", "hours", "department", "seniority", "remote", "tags_matched", "tag_categories", "last_indexed", "post_html"], | |
"filters" => array(array("field" => "job_name", "operator" => "CONTAINS_ANY", "value" => ["SEO", "Content Market", "Digital Market"])) | |
); | |
$options = array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH sample_data AS ( | |
SELECT 'https://www.example.com' AS url | |
) | |
SELECT | |
CASE | |
WHEN split_part(split_part(url, '://', 1), 'www.', 1) = url THEN url | |
WHEN split_part(url, '://', 1) = url and split_part(url, 'www.', 1) != url THEN split_part(url, 'www.', 2) | |
WHEN split_part(url, '://', 1) != url and split_part(url, 'www.', 1) = url THEN split_part(url, '://', 2) | |
ELSE split_part(split_part(url, '://', 2), 'www.', 2) | |
END as result |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Adds a menu on user opening the spreadsheet | |
function onOpen() { | |
options = [ | |
{name:"Move Rows", functionName:"moveRows"}, | |
]; | |
SpreadsheetApp.getActiveSpreadsheet().addMenu("~ Tools ~ ", options); | |
} | |
function moveRows() { | |
var sheet = SpreadsheetApp.getActiveSpreadsheet(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_stripe_checkout_session(checkout_session_id): | |
api_url = "https://api.stripe.com/v1/checkout/sessions/" | |
api_url += checkout_session_id | |
api_url += "?expand[]=line_items" | |
api_url += "&expand[]=customer" | |
api_url += "&expand[]=total_details.breakdown.discounts.discount" | |
api_url += "&expand[]=payment_intent.charges" | |
resp = requests.get( | |
api_url, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This allows us to add a custom menu to Google Sheets so users can trigger without diving into the code | |
function onOpen() { | |
options = [ | |
{name:"Amazon Autocomplete Lookup", functionName:"query_amazon_autocomplete"}, | |
]; | |
SpreadsheetApp.getActiveSpreadsheet().addMenu("* Tools * ", options); | |
} | |
function query_amazon_autocomplete() { | |
var sheet = SpreadsheetApp.getActiveSheet() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function checkUser() { | |
aws dynamodb get-item --table-name userTable --key '{"email": {"S": "'"$1"'"}}' | jq '.Item.field_1.S + " " + .Item.field_2_int.N' | |
} | |
# to use: | |
checkUser [email protected] |
NewerOlder