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 onInstall(e){ | |
onOpen(e); | |
} | |
function onOpen(e){ | |
var menu = SpreadsheetApp.getUi().createAddonMenu(); | |
menu.addItem('Remove Empty Rows', 'removeEmptyRows'); | |
menu.addToUi(); | |
} |
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 urllib.request | |
import urllib.error | |
# This function checks the headers returned from a urllib.request object | |
def check_imagelinks(imglist): | |
for img in imglist: | |
try: | |
with urllib.request.urlopen(img) as response: | |
# headers are returned as tuples so cast that as a list |
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
from selenium import webdriver | |
# Python 3.6.3 | |
# hold on to your butts | |
driver_path = '/usr/local/bin/chromedriver' | |
url = 'https://www.amazon.com/reviews/iframe?akid=AKIAIOWAH2MM2J3QSNPA&alinkCode=xm2&asin=B006R7AW6M&atag=AssociateTag%3Dsomeutility-20&exp=2017-11-02T21%3A59%3A44Z&v=2&sig=ljBbKJxQiq%252F90us8lfn1uDQ7VmXr%252BDknLvJ49jIsaHU%253D' | |
try: | |
browser = webdriver.Chrome(executable_path=driver_path) |
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 timestampIt(){ | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = ss.getSheets()[0]; // this will assign the first sheet | |
var cell = sheet.getRange('A1'); | |
var d = new Date(); | |
d.setHours(d.getHours() +1); | |
var user = Session.getActiveUser().getUserLoginId(); | |
user = String(user); | |
user = user.replace('@gmail.com', ''); | |
cell.setValue('Last updated: ' + d.toLocaleString() + ' by ' + user); |
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 involves some manual work depending on the type and category of an item | |
# See below !! CATEGORY / ITEM SPECIFIC INFO !! | |
import requests | |
from bs4 import BeautifulSoup as BS | |
# !! CATEGORY / ITEM SPECIFIC INFO | |
# This function is for the list filter and is some information that unfortunately couldn't be exluded with Beautiful Soup | |
# (or I just couldn't figure it out) |
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 re, csv | |
import pandas as pd | |
from collections import Counter | |
from random import randint | |
csvfile = 'mycsvfile.csv' | |
# regex = r'\w+' | |
regex = r"\b[^\d\W]+\b" # this will get omit words containing numbers like 4WD or a part number 123ABCD | |
commonWords = ['a', 'with', 'the', 'and', 'set', 'foot', 'for', 'inch', 'on', 'models', |
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
// node v 8.5.0 (should work with earlier as long as regex available) & ES6 | |
const axios = require('axios'); | |
const fs = require('fs'); | |
const parse = require('csv-parse'); | |
const delimiter = ','; | |
const filename = 'update.csv'; | |
const endpoint = 'https://api.ebay.com/ws/api.dll'; |
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 regex = /^(.*product)\/cache.*(\/[a-z]\/[a-z]\/.*)/g; | |
let testUri = window.prompt('Input the full image url to be cleaned:'); | |
let m; | |
let uriArr = []; | |
let cleanUri; | |
while ((m = regex.exec(testUri)) !== null) { | |
if (m.index === regex.lastIndex) { |
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 Item = function(name, cost){ | |
this.name = name; | |
this.isTopLevel = true; | |
this.baseCost = cost; | |
this.attributes = []; | |
this.totalCost = function(){ | |
let total = this.baseCost; | |
this.attributes.map(x=>{ | |
total += x.cost; | |
}) |
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 | |
$html = ' | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title><?=$title?></title> | |
</head> | |
<body> | |
<p id="thisP">Some stuff here to parse! ABCDEFGHIJKLMNOPQRSTUVWXYZ</p> |