Skip to content

Commit

Permalink
исправил функцию gads_get_geo_targets()
Browse files Browse the repository at this point in the history
  • Loading branch information
selesnow committed Apr 18, 2023
1 parent 6e887f3 commit b8e053a
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 13 deletions.
6 changes: 3 additions & 3 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 0.9.0
Date: 2023-03-30 13:38:54 UTC
SHA: eb3f0709884e525d2599f75fe48426ca14a371c5
Version: 0.9.2
Date: 2023-04-18 08:29:00 UTC
SHA: 6e887f3f066c637c70b60076d66ebfb9f2165634
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: rgoogleads
Title: Loading Data from 'Google Ads API'
Version: 0.9.1
Version: 0.9.2
Authors@R:
c(person(given = "Alexey",
family = "Seleznev",
Expand Down Expand Up @@ -32,7 +32,8 @@ Imports: gargle (>= 1.2.0),
rvest (>= 1.0.0),
memoise,
cachem,
rappdirs
rappdirs,
utils
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.1
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import(snakecase)
import(memoise)
import(cachem)
import(rappdirs)
import(utils)

# import from
importFrom(rlang,"%||%")
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# rgoogleads 0.9.2
* Исправил работу функции `gads_get_geo_targets()`, ранее данная функция сразу считывала справочник регионов из csv файла по ссылке, теперь Google в своей справке выкладывает не csv файл, а zip архив, поэтому функция сначала скачивает и распаковывает архив, а потом уже считывает данные из распакованного csv файла.

# rgoogleads 0.9.1
* Исправленна ссылка в документации функции `gads_get_accessible_customers()`.

Expand Down
13 changes: 12 additions & 1 deletion R/gads_get_geo_targets.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,21 @@ gads_get_geo_targets <- function(

}

# download zip
zip_file <- tempfile(fileext = '.zip')
download.file(file_link, zip_file)

# unzip csv file
file_name <- unzip(zipfile = zip_file, list = T)
unzip(zipfile = zip_file)

# read file
data <- read.csv(file_link) %>%
data <- read.csv(file_name$Name) %>%
rename_with(getOption('gads.column.name.case.fun'))

# remove temp file
file.remove(c(zip_file, file_name$Name))

# success msg
cli_alert_success('Success! Loaded {nrow(data)} rows!')

Expand Down
8 changes: 1 addition & 7 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,4 @@

0 errors | 0 warnings | 0 note

* Fix links:

Found the following (possibly) invalid URLs:
URL: https://developers.google.com/google-ads/api/rest/reference/rest/v10/customers/listAccessibleCustomers
From: man/gads_get_accessible_customers.Rd
Status: 404
Message: Not Found
* Critical update for `gads_get_geo_targets()` function.

0 comments on commit b8e053a

Please sign in to comment.