Skip to content

Instantly share code, notes, and snippets.

View markcam1's full-sized avatar

Cam markcam1

  • Oakland, California
View GitHub Profile
#!/bin/sh
# Mark Cameron: shell script to download website
printf "starting script ...\n\n"
# URL VARIABLE: THIS IS USED TO STORE THE URL (UNIFORM RESOURCE LOCATOR)
URL=https://asciiart.website/index.php?art=animals/horses
# THIS LINE USES WGET SOFTWARE TO DOWNLOAD DOCUMENTS FROM THE INTERNET
wget $URL
@markcam1
markcam1 / http_auth.py
Created May 13, 2019 21:20
HTTP Requests for Python with username/password example
import requests
import json
import logging
import getpass
import os
#logging config:
logging.basicConfig(level=logging.DEBUG,
format=' %(asctime)s - %(levelname)s - %(message)s')
logging.debug('Start of REMOTE DATA.................')
@markcam1
markcam1 / gui_main.py
Created May 13, 2019 21:07
tkinter gui example with buttons and display screen
import tkinter
from tkinter import ttk
from tkinter import messagebox
from tkinter import Text
import logging
# internal
from app_main import *
from data_storage.db_io import VersionDatabase
from customer.current_customer import CustomerManager
#logging
@markcam1
markcam1 / getParseHTML.py
Last active April 25, 2019 18:18
Python get URL, and parse HTML string
# GREAT SCHOOL API: https://www.greatschools.org/api/docs/school-search/
import requests
import json
import logging
import getpass
import bs4
#logging config:
logging.basicConfig(level=logging.DEBUG, format=' %(asctime)s - %(levelname)s - %(message)s')
@markcam1
markcam1 / simpleDownload.sh
Last active June 6, 2019 16:29
simple website download script with SHELL
#!/bin/sh
# Mark Cameron: shell script to download website
printf "starting script ...\n\n"
#Variable for file name
FILE=downloaded_site.txt
#Variable for website location
URL=http://example.com
@markcam1
markcam1 / dowloadWithAuth.py
Created April 24, 2019 23:30
Python: download website with basic auth and simple json parsing
import requests
import json
import logging
import getpass
#logging config:
logging.basicConfig(level=logging.DEBUG, format=' %(asctime)s - %(levelname)s - %(message)s')
logging.debug('Start of program')
@markcam1
markcam1 / Code_placeholder.js
Created February 28, 2019 20:40
Google App Scripts | Sheets Tutorial | json placeholder
/*
Google App Scripts - Sheets Tutorial
Author: Mark Cameron
*/
function showMessageBox() {
Browser.msgBox('You touched me!');
getWebsite();
}
@markcam1
markcam1 / Code_aerobatic.js
Created February 28, 2019 19:57
Google App Scripts | Sheets Tutorial | aerobatic auth
/*
Google App Scripts - Sheets Tutorial
Author: Mark Cameron
*/
function showMessageBox() {
Browser.msgBox('You touched me!');
getWebsite();
}
@markcam1
markcam1 / Code_dummyData.js
Created February 28, 2019 18:54
Google App Scripts | Sheets Tutorial | dummy data
/*
Google App Scripts - Sheets Tutorial
Author: Mark Cameron
*/
function showMessageBox() {
Browser.msgBox('You touched me!');
getWebsite();
}
@markcam1
markcam1 / Code_example.js
Created February 28, 2019 18:44
Google App Scripts | Sheets Tutorial | example.com
/*
Google App Scripts - Sheets Tutorial
Author: Mark Cameron
*/
function showMessageBox() {
Browser.msgBox('You touched me!');
getWebsite();
}