Skip to content

Instantly share code, notes, and snippets.

View erikgregorywebb's full-sized avatar
📈

Erik erikgregorywebb

📈
View GitHub Profile
# 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)
# import libraries
library(tidyverse)
library(scriptuRs)
library(tidytext)
library(shiny)
library(shinythemes)
library(rsconnect)
# import scriptures
scriptures = scriptuRs::lds_scriptures()
library(tidyverse)
library(rvest)
# read in parcel list
url = 'https://gist.githubusercontent.com/erikgregorywebb/741b472a8ae1bb97d617eda3d6aaea3d/raw/aef7b5083670659788a009185e0e055d0ac1b350/gila-buttes-parcel-search.csv'
parcels_df = read_csv(url)
parcels = parcels_df %>% pull(`PARCEL NUMBER`) %>% str_replace_all(., '-', '')
# scrape details
PARCEL NUMBER OWNER NAME MAILING CITY & STATE SUBDIVISION NAME
509-84-3490 VALDEZ RACHEL SUSAN CASA GRANDE AZ GILA BUTTES PHASE 1
509-84-3500 PAUL SCHLANGER & MICHELLE SCHLANGER LLC CASA GRANDE AZ GILA BUTTES PHASE 1
509-84-3510 DR HORTON INC CASA GRANDE AZ GILA BUTTES PHASE 1
509-84-3520 BALAORO MARK B & LAURA TRS CASA GRANDE AZ GILA BUTTES PHASE 1
509-84-3530 CLEMENT MATTHEW CASA GRANDE AZ GILA BUTTES PHASE 1
509-84-3540 BALAORO MARK B & LAURA TRS CASA GRANDE AZ GILA BUTTES PHASE 1
509-84-3550 VENZON JENNIFER ANN & ROBBY PATDO CASA GRANDE AZ GILA BUTTES PHASE 1
509-84-3560 BOOKER WILLIAM DEVON JR CASA GRANDE AZ GILA BUTTES PHASE 1
509-84-3570 GEARY JAMES H CASA GRANDE AZ GILA BUTTES PHASE 1
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
import pandas as pd
def getListingLinks(link):
# Open the driver
driver = webdriver.Chrome(executable_path="/Users/erikgregorywebb/Downloads/chromedriver 2")
driver.get(link)
library(rvest)
url = 'https://mesamarathon.com/results?pk=7675253'
page = read_html(url)
paths = page %>% html_nodes('.photo') %>% html_attr('src') %>% str_replace(., '_thumb', '')
setwd("~/Downloads")
for (i in 1:length(paths)) {
file_name = paste('file-kristin-', i, '.jpg', sep = '')
download.file(paths[i], file_name)
# import libraries
library(aws.s3)
library(tidyverse)
library(jsonlite)
library(stringr)
library(ggbump)
library(cowplot)
# setting keys
Sys.setenv("AWS_ACCESS_KEY_ID" = "AWS_ACCESS_KEY_ID",
library(rvest)
library(tidyverse)
url = 'https://getclair.com/about/team'
page = read_html(url)
raw = raw = page %>% html_nodes('.transition-all') %>% html_text2()
df = tibble(name = str_replace(raw[str_detect(raw, '\n\n')], '\n\n', ', '), scraped_at = Sys.time())
library(tidyverse)
library(rvest)
library(stringr)
# scape all the article links
all_links = c()
url = 'https://www.theneedledrop.com/articles?category=Reviews'
while (url != 'end') {
Sys.sleep(3)
page = read_html(url)
# define functions
uClassifyURL = function(key, classifierName, text) {
text = gsub(" ", "+", text)
url = sprintf("https://api.uclassify.com/v1/uClassify/%s/classify/?readKey=%s&text=%s", classifierName, key, text)
return(url)
}
categoryMatch = function(url) {
raw = httr::GET(url)
content = rawToChar(raw$content)