Skip to content

Instantly share code, notes, and snippets.

Mitch wmcraver

Block or report user

Report or block wmcraver

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
wmcraver / DocuSignDownloader.r
Last active Aug 7, 2018
This R script will login to your DocuSign account, retrieve a list of all envelopes, filter the list of envelopes for those with a status of 'completed', and then download said envelopes into one neat PDF. If you use this script, you will need to uncomment lines 5-7 and enter your username, password, and integrator key.
View DocuSignDownloader.r
# Create env variables based on github directions for this package.
# Sys.setenv("docuSign_username" = "username")
# Sys.setenv("docuSign_password" = "password")
# Sys.setenv("docuSign_integrator_key" = "integrator_key")
login = docu_login()
wmcraver / wordCap.js
Created Apr 6, 2017
Tealium Extension - capitalize first letter of each word in string
View wordCap.js
// = // The data layer value goes here. Should look like: one two three.
channelSplit =" ");
for (i = 0; i < channelSplit.length; i++) {
channelSplit[i] = channelSplit[i].substring(0,1).toUpperCase() + channelSplit[i].substring(1,channelSplit[i].length);
} = channelSplit.join(" "); // Change sectionName to the data layer variable. should look like: One Two Three.
wmcraver / urltools.r
Created Jan 19, 2017
A quick script I use to extract key items from URLs. This makes quick work for double checking the structure of SEO/SEM URLs.
View urltools.r
# Read in the URLs
dat = read.csv("LandingPageURLs.csv", stringsAsFactors = F)
# Extract the scheme, domain, and path from the urls
dat$scheme = scheme(dat$LandingPage)
dat$domain = domain(dat$LandingPage)
dat$path = path(dat$LandingPage)
wmcraver / CapSectionName.js
Created Jan 17, 2017
Javascript extension for Tealium to capitalize the first letter of a section name so that they are consistent in the system.
View CapSectionName.js
sectionName = "word word word"; // The data layer value goes here. Should look like: best western rewards.
sectionNameSplit = sectionName.split(" "); // Split the sectionName into an array -- separator is a space.
for (i = 0; i < sectionNameSplit.length; i++) {
sectionNameSplit[i] = sectionNameSplit[i].substring(0,1).toUpperCase() + sectionNameSplit[i].substring(1,sectionNameSplit[i].length);
sectionName = sectionNameSplit.join(" "); // "Word Word Word" stored back in sectionName
// Change sectionName to value being sent to Analytics system from Tealium.
wmcraver / hourlyRevByDOW.r
Last active Jan 16, 2017
Use rSiteCatalyst to get the average revenue by day of week and hour of day for the last 30 days.
View hourlyRevByDOW.r
# SCAuth Info -------------------------------------------------------------
SCAuth(key = "", #fill in with your own info
secret = "", #fill in with your own info
company = "" #fill in with your own info
wmcraver / rvesttest.r
Created Jan 13, 2017
Test Web Scraping
View rvesttest.r
url2 = read_html("")
newxpath = as.character('//*+[contains(concat( " ", @class, " " ), concat( " ", "sidebar-widget", " " ))]//*[contains(concat( " ", @class, " " ), concat( " ", "sidebar-widget", " " ))]//ul')
titles = html_nodes(url2, css = "p")
titles = html_text(titles)
wmcraver / eVarsTesting.R
Last active Nov 22, 2016
Provides an way to check if eVars in Adobe Analytics are receiving data and also a way to see what the data look like.
View eVarsTesting.R
wmcraver / WriteXLS.R
Last active Nov 10, 2016
Write multiple data frames to multiple sheets in one spreadsheet
View WriteXLS.R
# renderedExperience, marketingChannel, allMetrics are data frames
sheetList <-list("Rendered Experience" = renderedExperience, "Marketing Channel" = marketingChannel, "Key Metrics" = allMetrics)
x = sheetList,
ExcelFileName = "RenderedExperience-MarketingChannel.xlsx",
SheetNames = names(sheetList),
View urlStatusChecker.R
urlStatusChecker = function(file,urlcol) {
dat = read.csv(file, stringsAsFactors = F)
for (i in 1:nrow(dat)) {
dat = dat[dat[urlcol] != "",]
dat = dat = dat[![urlcol]),]
a = GET(dat[i,urlcol])
dat$URL[i] = a$url
View CheckURLs.R
dat = read.csv("fileWithURLs.csv", stringsAsFactors = F)
---------------- for loop to get results ----------------
for (i in 1:nrow(dat)) {
a = GET(dat$Current.Forward[i])
dat$URL[i] = a$url
You can’t perform that action at this time.