This file contains 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 libraries | |
library(tidyverse) | |
library(rvest) | |
library(scales) | |
# get links to data files | |
url = 'https://github.com/erikgregorywebb/github-actions-demo/tree/main/data' | |
page = read_html(url) | |
all_paths = page %>% html_nodes('a') %>% html_attr('href') | |
paths = all_paths[str_detect(all_paths, '/erikgregorywebb/github-actions-demo/blob/main/data/fm-rates')] |
This file contains 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 | |
from bs4 import BeautifulSoup | |
import pandas as pd | |
from datetime import datetime | |
# get page content | |
url = 'http://www.freddiemac.com/' | |
page = requests.get(url) | |
soup = BeautifulSoup(page.content, "html.parser") |
This file contains 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 pandas as pd | |
from scipy import stats | |
import time | |
coin_api_key = 'YOUR-KEY-HERE' | |
slack_token = 'YOUR-KEY-HERE' | |
# define functions | |
def COINprices(crypto): |
This file contains 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 libraries | |
import pandas as pd | |
import numpy as np | |
import folium | |
import matplotlib.cm | |
# define color vector function | |
def ColorVector(values, number_of_colors, cmap_name): | |
buckets = pd.qcut(values, number_of_colors).codes | |
cmap = matplotlib.cm.get_cmap(name = cmap_name) |
This file contains 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
# data source: https://www.cargurus.com/Cars/price-trends/ | |
library(tidyverse) | |
library(dplyr) | |
library(httr) | |
library(jsonlite) | |
library(broom) | |
library(lubridate) | |
library(scales) |
This file contains 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 | |
library(webshot) | |
# set working directory | |
setwd("~/Downloads") | |
# extract as .pdf files | |
webshot("https://www.getdbt.com/analytics-engineering/start-here/", "dbt-1-start-here.pdf") | |
webshot("https://www.getdbt.com/what-is-analytics-engineering/", "dbt-2-what-is-analytics-engineering.pdf") | |
webshot("https://www.getdbt.com/analytics-engineering/why/", "dbt-3-why.pdf") |
This file contains 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
# demo | |
import pyautogui | |
import winsound | |
frequency = 1500 # in Hertz | |
duration = 200 # 1000 ms == 1 second | |
winsound.Beep(frequency, duration) | |
path = r'C:\Users\erikgregorywebb\Documents\..\my_screenshot.png' | |
pyautogui.screenshot(path) |
This file contains 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 twilio.rest import Client | |
# create client | |
account_sid = 'YOUR-ACCOUNT-SID' | |
auth_token = 'YOUR-AUTH-TOKEN' | |
client = Client(account_sid, auth_token) | |
# define message function | |
def sendMessage(body, from_, to): | |
message = client.messages.create(body = body, from_ = from_, to = to) |
This file contains 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 twilio.rest import Client | |
try: | |
# run some code | |
message = 'Success!' | |
except: | |
# if it fails | |
message = 'Job failed!' |
This file contains 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
library(rvest) | |
url = 'https://genius.com/#top-songs' | |
page = read_html(url) | |
top_songs = page %>% html_nodes('.qsIlk') %>% html_attr('href') |