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
#Top 100 Pages where the pagename starts with "Categories" | |
#Uses searchKW argument | |
queue_ranked_pages_search <- QueueRanked("production", | |
"2013-01-01", | |
"2014-01-28", | |
c("pageviews", "visits"), | |
"page", | |
top = "100", | |
searchKW = "^Categories" | |
) |
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
#Change timing of function call | |
#Wait 30 seconds between attempts to retrieve the report, try 5 times | |
queue_overtime_visits_pv_day_social_anomaly2 <- QueueOvertime("production", | |
"2013-01-01", | |
"2014-01-28", | |
c("visits", "pageviews"), | |
"day", | |
"Visit_Social", | |
anomalyDetection = "1", | |
currentData = "1", |
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
#Twitter response comes back as string | |
#Use JSON.jl to make into a Dict | |
#Create a custom type from Dict, in this case TWEETS | |
#Want to define a DataFrame method DataFrame(response::Array{TWEETS,1}) | |
20-element Array{TWEETS,1}: | |
TWEETS(nothing,nothing,"Thu Mar 06 17:19:12 +0000 2014",nothing,["symbols"=>{},"user_mentions"=>{["screen_name"=>"randyzwitch","id_str"=>"98689850","id"=>98689850,"name"=>"Randy Zwitch","indices"=>{0,12}]},"hashtags"=>{},"urls"=>{}],0,false,nothing,441624046657355777,"441624046657355777","randyzwitch",441623445286436864,"441623445286436864",98689850,"98689850","en",nothing,nothing,nothing,1,true,nothing,"<a href=\"http://janetter.net/\" rel=\"nofollow\">Janetter</a>","@randyzwitch the R gods demand sacrifice!!!!!!!!!!!!!!!",false,["screen_name"=>"Randy_Au","profile_use_background_image"=>true,"id_str"=>"148398537","utc_offset"=>nothing,"listed_count"=>7,"profile_sidebar_border_color"=>"C0DEED","profile_image_url"=>"http://pbs.twimg.com/profile_images/2751420418/7f1ff3346d047d82ca93b9413 |
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 DataFrame(array::Array{TWEETS, 1}) | |
#Empty df as container for results | |
resultdf = DataFrame() | |
#Get array of field names as symbols from composite type | |
cols = names(TWEETS) | |
#For each field in composite type... | |
for column in cols |
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 Real-Time reports that already set up | |
realtime_reports <- GetRealTimeConfiguration("<reportsuite>") |
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
SaveRealTimeConfiguration("<report suite>", | |
metric1 = "instances", | |
elements1 = c("page", "referringdomain", "sitesection"), | |
metric2 = "revenue", | |
elements2 = c("referringdomain", "sitesection") | |
metric3 = "orders", | |
elements3 = c("products") | |
) |
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
GetRealTimeReport("<report suite>", "instances") |
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
GetRealTimeReport("<report suite>", | |
"instances", | |
periodMinutes = "5", | |
periodCount = "12", | |
periodOffset = "10") |
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
GetRealTimeReport("mlcpwmproduction", | |
"instances", | |
"page", | |
periodMinutes = "9", | |
periodCount = "3") |
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
#"metrics" would be a user input into a function arguments | |
metrics <- c("a", "b", "c") | |
#Loop over the metrics list, appending proper curly braces | |
metrics_conv <- lapply(metrics, function(x) paste('{"id":', '"', x, '"', '}', sep="")) | |
#Collapse the list into a proper comma separated string | |
metrics_final <- paste(metrics_conv, collapse=", ") |
OlderNewer