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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# | |
# Copyright 2012 Google Inc. All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |
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(dplyr) | |
library(ggplot2) | |
library(lubridate) | |
library(XML) | |
#load apple health export.xml file | |
xml <- xmlParse("C:\\Users\\praskry\\Desktop\\apple_health_data\\export.xml") | |
#transform xml file to data frame - select the Record rows from the xml file | |
df <- XML:::xmlAttrsToDataFrame(xml["//Record"]) |
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
<script type="text/javascript"> | |
(function(dataLayer) { | |
var i = 0; | |
var jwpVideoIsPlaying = false; | |
//array of percentages at which progress notifications are pushed to the dataLayer | |
var markers = [10, 25, 50, 75, 90]; //adjust these values if you want different progress reports | |
var playersMarkers = []; | |
function findObjectIndexById(haystack, key, needle) { | |
for (var i = 0; i < haystack.length; i++) { |
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
// get time stamp of query run | |
function setTimeStamp(sheetName) { | |
SpreadsheetApp.getActive().getSheetByName(sheetName) | |
.getRange('C2').setValue(new Date()) | |
} | |
// gaGet data | |
function gaGet(tableId, metrics, options) { | |
// Apply standard options | |
options = options || {}; |
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
function connectToCloudSQL() { | |
var params = { | |
ip: "INSERT IP", | |
user: "INSERT USER", | |
password: "INSERT PASSWORD", | |
database: "INSERT DATABASE" | |
} | |
var dbUrl = 'jdbc:mysql://' + params.ip + '/' + params.database; |
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
## A script to download and archive Google search console analytics (formerly webmaster tools) | |
## | |
## searchConsoleR package created by Mark Edmondson (http://markedmondson.me) | |
## | |
## This script downloads and writes data to .csv for the most recent day of search console data (3 days ago) | |
## load the required libraries | |
## (Download them with install.packages("googleAuthR") and install.packages("searchConsoleR") if necessary | |
library(googleAuthR) | |
library(searchConsoleR) |
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(googleAnalyticsR) | |
library(tidyr) | |
#Authorized Google Analytics R- this will open a webpage | |
#You must be logged into your Google Analytics account on your web browser | |
ga_auth() | |
#Use the Google Analytics Management API to see a list of Google Analytics accounts you have access to | |
my_accounts <- google_analytics_account_list() | |
View(my_accounts) |
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(googleAnalyticsR) | |
library(ggplot2) | |
#Authorize Google Analytics R- this will open a webpage | |
#You must be logged into your Google Analytics account on your web browser | |
ga_auth() | |
#Use the Google Analytics Management API to see a list of Google Analytics accounts you have access to | |
my_accounts <- google_analytics_account_list() | |
View(my_accounts) |
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
function uploadData() { | |
var accountId = "xxxxxxxx"; | |
var webPropertyId = "UA-xxxxxxxx-x"; | |
var customDataSourceId = "xxxxxxxx"; | |
var ss = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); | |
var maxRows = ss.getLastRow(); | |
var maxColumns = ss.getLastColumn(); | |
var data = []; | |
for (var i = 1; i <= maxRows; i++) { | |
data.push(ss.getRange([i], 1, 1, maxColumns).getValues()); |
NewerOlder