From dc548c43902fe9526246c9ec0269ad92df4b4b8b Mon Sep 17 00:00:00 2001 From: Alexey Seleznev Date: Tue, 16 Jan 2024 15:05:07 +0200 Subject: [PATCH] Migrate to api v 18 --- .Rbuildignore | 3 +-- CRAN-SUBMISSION | 6 +++--- DESCRIPTION | 4 ++-- Meta/vignette.rds | Bin 418 -> 341 bytes NEWS.md | 23 ++++++++++++++++++++- R/authorization.R | 2 +- R/zzz.R | 2 +- README.md | 2 +- cran-comments.md | 4 ++-- man/fbAuth.Rd | 2 +- man/fbGetMarketingStat.Rd | 4 ++-- man/fbGetToken.Rd | 2 +- tests/main_tests.R | 5 ++++- vignettes/rfacebookstat-get-statistics.Rmd | 2 +- 14 files changed, 42 insertions(+), 19 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index f692cc6..7cc3311 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -6,9 +6,8 @@ _config.yml ^getToken$ index.md ^doc$ -^Meta$ .RData .Rhisroty ^cran-comments\.md$ ^CRAN-SUBMISSION$ -^vignettes \ No newline at end of file +^Meta$ diff --git a/CRAN-SUBMISSION b/CRAN-SUBMISSION index 4694770..3987f24 100644 --- a/CRAN-SUBMISSION +++ b/CRAN-SUBMISSION @@ -1,3 +1,3 @@ -Version: 2.9.3 -Date: 2023-05-16 11:05:03 UTC -SHA: bd10f648df60ae82b271fd086acc35087e513339 +Version: 2.9.9 +Date: 2024-01-15 17:07:14 UTC +SHA: e9ce8225a8da71f5d960b843c6800b48e0af01c3 diff --git a/DESCRIPTION b/DESCRIPTION index f0e1f1c..bda4e03 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: rfacebookstat Type: Package Title: Load Data from Facebook API Marketing -Version: 2.9.4 +Version: 2.9.9 Authors@R: c(person(given = "Alexey", family = "Seleznev", @@ -27,5 +27,5 @@ URL: https://selesnow.github.io/rfacebookstat/, https://www.youtube.com/playlist License: MIT + file LICENSE Suggests: knitr, rmarkdown Encoding: UTF-8 -RoxygenNote: 7.2.1 +RoxygenNote: 7.2.3 VignetteBuilder: knitr diff --git a/Meta/vignette.rds b/Meta/vignette.rds index e8cc48ca8920cfafcd158a9c8f08808efa9f007f..773c46924d8c8d737519dfccb24cc24d0999e57b 100644 GIT binary patch literal 341 zcmV-b0jmBViwFP!0000028EK}OT#b_$Fr?YHxPt9iN9`tKnv<$Fc}*|g&{up8r!T5 zZ4*gO#(eT0*O}Ht+v4g&E_cc2@;&bIG$e#{iPtmMEYcep(>Lp=2#7}pX1`D?8nS08 zQ;igT`ihBE{EZ@)B6!Fni=EW5P-^reinM}29f=wGg~K)SP?ua?`Rp=)$#MZM3no=< z3*B4?a3^WRMFe5S!xU)Y8F?t=VWngaGxq`)C}A#ToH3XPnr#Yc`_lL-fH}io_@1hi zAr~<$gywOAjryRiGYRIImY1+~Kfn(Mp+o6McRGkL8vVCIbKfct4;| literal 418 zcmV;T0bTwdiwFP!0000028EN)Pr@)1$IA~Pfe$u&pGfQ?p;qidKabMi=Ks;bR#pM@uez`k=I^A`w& zJQVk0g!u$R8eiOs5ueBv84H1e=qunKz)HP*h z;(Ax>#+6|=UFEJF8~q-2z)uPl9onnLV(ao(@?e-wr(cT|=@xP0isE1?x}uf?`@#GE M0m=Ve2aE#%0HRCJeEemail: selesnow@gmail.com
skype: selesnow
facebook: [facebook.com/selesnow](https://www.facebook.com/selesnow) diff --git a/cran-comments.md b/cran-comments.md index 7e98e3f..678a3b4 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,5 +1,5 @@ ## R CMD check results -0 errors | 0 warnings | 0 note +0 errors | 0 warnings | 1 note -* check and rebuild vignetts. +* Fix "Package has a VignetteBuilder field but no prebuilt vignette index.". diff --git a/man/fbAuth.Rd b/man/fbAuth.Rd index 900a2db..209ddf3 100644 --- a/man/fbAuth.Rd +++ b/man/fbAuth.Rd @@ -22,7 +22,7 @@ fbAuth(username = getOption("rfacebookstat.username"), \item{app_id}{ID of Facebook App} \item{app_secret}{Secret of Facebook App} \item{token_path}{path to dir with credentials} - \item{scopes}{Permissions provide a way for your app to access data from Facebook. For detail see \href{https://developers.facebook.com/docs/permissions/reference/}{docmentation}} + \item{scopes}{Permissions provide a way for your app to access data from Facebook. For detail see \href{https://developers.facebook.com/docs/permissions}{docmentation}} \item{reauth}{boolean, do reauthorization} \item{skip_option}{logical, skip access token from options or not} } diff --git a/man/fbGetMarketingStat.Rd b/man/fbGetMarketingStat.Rd index edd0a2f..edf46b7 100644 --- a/man/fbGetMarketingStat.Rd +++ b/man/fbGetMarketingStat.Rd @@ -27,7 +27,7 @@ fbGetMarketingStat( \item{level}{Represents the level of result. Avable ad, adset, campaign, account.} \item{action_breakdowns}{group results in the actions field. You can use the following breakdowns for action_breakdowns, for details \href{https://developers.facebook.com/docs/marketing-api/insights/breakdowns/#actionsbreakdown}{go}, or see details} \item{breakdowns}{Permutations marked with an asterisk (*) can be joined with action_type and action_target_id. Avable age, country, gender, frequency_value, hourly_stats_aggregated_by_advertiser_time_zone, hourly_stats_aggregated_by_audience_time_zone, impression_device, place_page_id, placement, device_platform, product_id, region. See details.} - \item{fields}{List of fields which you want get in R. You can find list of available fields at Facebook API documentation by this \href{https://developers.facebook.com/docs/marketing-api/insights/parameters#fields}{link}.} + \item{fields}{List of fields which you want get in R.} \item{filtering}{Vector of filtring or JSON string with array of filtring parameters, on example \code{"ad.effective_status IN ARCHIVED"} \code{[{/'field/':/'ad.effective_status/',/'operator/':/'IN/',/'value/':[/'ARCHIVED/']}}, see filtring block for more examples} \item{date_start}{Start reporting date.} \item{date_stop}{End reporting day} @@ -172,7 +172,7 @@ Filtring with operators IN_RANGE, NOT_IN_RANGE, IN, NOT_IN \author{Alexey Seleznev} \seealso{ -All avable field, and discription of all parameters you can see oh this \href{https://developers.facebook.com/docs/marketing-api/insights/parameters}{link}. +All avable field, and discription of all parameters you can see oh this \href{https://developers.facebook.com/docs/marketing-api/reference/ad-account/insights}{link}. More information about breakdowns and action brekdowns on this \href{https://developers.facebook.com/docs/marketing-api/insights/breakdowns}{link}. More information about action field in this \href{https://developers.facebook.com/docs/marketing-api/reference/ads-action-stats/}{documentation}. } diff --git a/man/fbGetToken.Rd b/man/fbGetToken.Rd index 8029ba2..4d6b22a 100644 --- a/man/fbGetToken.Rd +++ b/man/fbGetToken.Rd @@ -13,7 +13,7 @@ fbGetToken( \arguments{ \item{app_id}{ID of your Facebook App} -\item{scopes}{Permissions provide a way for your app to access data from Facebook. For detail see \href{https://developers.facebook.com/docs/permissions/reference/}{docmentation}} +\item{scopes}{Permissions provide a way for your app to access data from Facebook. For detail see \href{https://developers.facebook.com/docs/permissions}{docmentation}} } \value{ API token diff --git a/tests/main_tests.R b/tests/main_tests.R index ca6c0af..673c11f 100644 --- a/tests/main_tests.R +++ b/tests/main_tests.R @@ -1,5 +1,8 @@ library(rfacebookstat) library(dplyr) +fbAuth(username = 'selesnow', skip_option = T) +fbSetUsername('selesnow') +fbGetSettings() # accounts bm <- fbGetBusinessManagers() @@ -13,7 +16,7 @@ ads <- fbGetAds(test_accs) creo <- fbGetAdCreative(test_accs) apps <- fbGetApps() pages <- fbGetPages(test_accs) -videos <- fbGetAdVideos(my_acs$id[4:10]) +videos <- fbGetAdVideos(test_accs) conversions <- fbGetAdAccountsConversions(test_accs) # users bm_users <- fbGetBusinessManagersUsers(bm$id[1]) diff --git a/vignettes/rfacebookstat-get-statistics.Rmd b/vignettes/rfacebookstat-get-statistics.Rmd index 569113b..5851e53 100644 --- a/vignettes/rfacebookstat-get-statistics.Rmd +++ b/vignettes/rfacebookstat-get-statistics.Rmd @@ -27,7 +27,7 @@ knitr::opts_chunk$set( * *level* - Уровень группировки данных, принимает одно из следующих значений: ad, adset, campaign, account. По умолчанию имеет значение account. * *action_breakdowns* - Разбивки по действиям, более подробно о них можно узнать в [документации](https://developers.facebook.com/docs/marketing-api/insights/breakdowns#actionsbreakdown) к API Facebook, так же более подробно они будут рассмотрены позже в этой виньетке. * *breakdowns* - Общие разбивки которые предоставляют дополнительные возможности по группировке данных, подробности в [документации](https://developers.facebook.com/docs/marketing-api/insights/breakdowns#ageandgender) к API Facebook, так же этот аргумент будет более подробно рассмотрен немного ниже. -* *fields* - Поля которые вы хотите загрузить из API, полный список всех полей доступен по [ссылке](https://developers.facebook.com/docs/marketing-api/insights/parameters#fields). +* *fields* - Поля которые вы хотите загрузить из API, полный список всех полей доступен по [ссылке](https://developers.facebook.com/docs/marketing-api/reference/ad-account/insights). * *filtering* - Текстовая строка или вектор. Фильтрацию отчёта вы можете задавать либо в JSON формате либо в упрощенном формате, более подробно о фильтрации будет написано немного ниже. * *date_start* - Дата начала отчётного периода. * *date_stop* - Дата завершения рабочего отчётного периода.