Skip to content

Instantly share code, notes, and snippets.

View mike-weiner's full-sized avatar

Michael Weiner mike-weiner

View GitHub Profile
@mike-weiner
mike-weiner / gh-parser.sh
Last active January 23, 2022 02:32
A bash script that uses the GitHub CLI and JQ to parse and print specific information about open Issues or PRs using .
#!/bin/bash
# Function that will print requirements if the user passes in the -help flag as the first argument
function help
{
echo "Parameters are: "
echo "[Required]: search-term"
}
# Check for '-help' flag
@mike-weiner
mike-weiner / weather-link.py
Last active September 16, 2023 01:02
A Python script to serve as a template for WeatherLink API calls.
@mike-weiner
mike-weiner / opensea.py
Created January 5, 2022 01:17
A Python script to utilize the OpenSea API to get all available information on a single asset listed.
import json
import requests
# https://opensea.io/assets/<your-asset-contract-address>/<your-token-id>
ASSETCONTRACTADDRESS = "<your-asset-contract-address>" # Replace with your Asset Contract Address
TOKENID = "<your-token-id>" # Replace with your Token ID
# Construct URL for OpenSea API to make GET call
url = "https://api.opensea.io/api/v1/asset/" + ASSETCONTRACTADDRESS + "/" + TOKENID + "/"
@mike-weiner
mike-weiner / basecamp.py
Last active August 23, 2023 14:36
A Python script to make calls to the Basecamp 4 API via OAuth authentication.
import datetime
import json
import os.path
import requests
# TO DO: Enter Your BC Account ID
# Example: 999999999 from https://3.basecamp.com/999999999/
BC_ACCOUNT_ID = "<your-client-id>"
# Basecamp App Integration Information
@mike-weiner
mike-weiner / newnote.sh
Last active May 17, 2021 14:55
A bash script that will create a new file with the given name in the command line argument, save it in a specified directory, and open it in VSCode.
#!/bin/bash
#
# Script that will start VSCode with a new file saved in a specified directory to edit.
# Filename of the new file saved will be taken in as an argument
# Directory will be specified within the script
#
# Location of the directory where the files created by the script should be stored
file_location=${HOME}/Documents/Programming/scratchpad
@mike-weiner
mike-weiner / vaccine-spotter.py
Last active May 12, 2021 00:47
A Python version of a script that will use the open source Vaccine Spotter API to print out all vaccine centers in a specific city with which vaccine sites have appointments available.
import json
import requests
# get API url provided by https://www.vaccinespotter.org/api/
# this URL can be changed to any of the other states found at the URL above
URL = "https://www.vaccinespotter.org/api/v0/states/MN.json" # CHANGE STATE HERE
requestResponse = requests.get(URL)
parsedJSONResponse = requestResponse.json()
@mike-weiner
mike-weiner / crypto-price.py
Last active July 8, 2021 01:22
A Python script that uses the Coinbase API to get the current spot price of specified cryptocurrencies.
# import required tools
import requests
from datetime import datetime
# print current date and time
print(datetime.now())
print()
# define array of cryptos to get the spot price of
CRYPTO = ["BTC-USD", "ETH-USD", "LTC-USD"] # Change this array to set what crypto currencies you want a spot price of