Skip to content

Commit

Permalink
checks
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkEdmondson1234 committed Jan 2, 2018
1 parent 8c0a43b commit 89d65cd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 19 deletions.
13 changes: 2 additions & 11 deletions R/getData.R
@@ -1,10 +1,3 @@
options("googleAuthR.scopes.selected" = getOption("searchConsoleR.scope") )
options("googleAuthR.client_id" = getOption("searchConsoleR.client_id"))
options("googleAuthR.client_secret" = getOption("searchConsoleR.client_secret"))
options("googleAuthR.webapp.client_id" = getOption("searchConsoleR.webapp.client_id"))
options("googleAuthR.webapp.client_secret" = getOption("searchConsoleR.webapp.client_secret"))


#' Query search traffic keyword data
#'
#' @description Download your Google SEO data.
Expand Down Expand Up @@ -45,7 +38,7 @@ options("googleAuthR.webapp.client_secret" = getOption("searchConsoleR.webapp.cl
#' \item 'device'
#' \item 'page'
#' \item 'query'
#' \item 'searchAppearance'
#' \item 'searchAppearance' (can only appear on its own)
#' }
#' The grouping dimension values are combined to create a unique key
#' for each result row. If no dimensions are specified,
Expand Down Expand Up @@ -150,7 +143,6 @@ search_analytics <- function(siteURL,
endDate = Sys.Date() - 3,
dimensions = NULL,
searchType = c("web","video","image"),
searchAppearance = NULL,
dimensionFilterExp = NULL,
aggregationType = c("auto","byPage","byProperty"),
rowLimit = 1000,
Expand Down Expand Up @@ -216,8 +208,7 @@ search_analytics <- function(siteURL,
# up to the limit you have set
if(rowLimit > 5000){
message("Batching data via method: ", walk_data)
message("With rowLimit set to ", rowLimit ,"
will need up to [", (rowLimit %/% 5000) + 1, "] API calls")
message("With rowLimit set to ", rowLimit ," will need up to [", (rowLimit %/% 5000) + 1, "] API calls")
rowLimit0 <- rowLimit
rowLimit <- 5000
} else {
Expand Down
2 changes: 1 addition & 1 deletion README.md
@@ -1,6 +1,6 @@
# searchConsoleR

[![CRAN](http://www.r-pkg.org/badges/version/searchConsoleR)](http://cran.r-project.org/package=searchConsoleR)
[![CRAN](http://www.r-pkg.org/badges/version/searchConsoleR)](https://CRAN.R-project.org/package=searchConsoleR)
[![Travis-CI Build Status](https://travis-ci.org/MarkEdmondson1234/searchConsoleR.svg?branch=master)](https://travis-ci.org/MarkEdmondson1234/searchConsoleR)

R interface with Google Search Console (formally Google Webmaster Tools) API v3.
Expand Down
8 changes: 4 additions & 4 deletions man/search_analytics.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions tests/testthat/test-searchConsoleR.R
Expand Up @@ -46,10 +46,9 @@ test_that("Can get search analytics data lots of dims with batching", {

test_that("Can get search analytics data lots of dims with date", {
skip_on_cran()
sa2 <- search_analytics(my_example,
sa2 <- search_analytics(my_example, startDate = Sys.Date() - 10,
dimensions = c("date","device", "country" ,"query","page"),
walk_data = "byDate",
rowLimit = 9999)
walk_data = "byDate")

expect_s3_class(sa2, "data.frame")

Expand Down

0 comments on commit 89d65cd

Please sign in to comment.