Skip to content

Commit c479c55

Browse files
authored
Merge pull request #141 from rladies/pro fix #118 #112
rewrite PRO functions to query GraphQL
2 parents cd999d7 + 8acc117 commit c479c55

33 files changed

+931
-11345
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@
1616
^~/\.local/share/meetupr/meetupr-token\.rds$
1717
^codecov\.yml$
1818
^LICENSE\.md$
19+
^~/Library/Application Support/meetupr/meetupr-token\.rds$

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ vignettes/*.html
1010
docs
1111
tests/testthat/.meetup_token.rds
1212
~/.local/share/meetupr/meetupr-token.rds
13+
~/Library/Application Support/meetupr/meetupr-token.rds

DESCRIPTION

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ Imports:
2929
purrr,
3030
gh,
3131
progress,
32-
tibble,
3332
rlang,
3433
rappdirs,
3534
glue,

NAMESPACE

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# Generated by roxygen2: do not edit by hand
22

33
export(find_groups)
4-
export(get_boards)
54
export(get_event_attendees)
65
export(get_event_comments)
76
export(get_event_rsvps)
87
export(get_events)
98
export(get_members)
9+
export(get_pro_events)
10+
export(get_pro_groups)
1011
export(meetup_auth)
1112
export(meetup_deauth)
1213
export(meetup_query)

R/find_groups.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
#' @param lat Latitude. An integer
77
#' @param lon Longitutde. An integer
88
#' @param radius Radius. An integer
9-
#' @param extra_graphql A graphql object. Extra objects to return
10-
#' @param token Meetup token
9+
#' @param ... Should be empty. Used for parameter expansion
10+
#' @template extra_graphql
11+
#' @template token
1112
#' @importFrom anytime anytime
1213
#' @export
1314
find_groups <- function(

R/get_boards.R

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
#' Get the discussion boards from a meetup group
2-
#'
3-
#' @template urlname
4-
#' @template verbose
5-
#' @return A tibble with the following columns:
6-
#' * id
7-
#' * name
8-
#' * description
9-
#' * created
10-
#' * updated
11-
#' * post_count
12-
#' * discussion_count
13-
#' * latest_reply_created
14-
#' * latest_reply_member_name
15-
#' * resource
16-
#'
17-
#' @references
18-
#' \url{https://www.meetup.com/meetup_api/docs/:urlname/boards/}
19-
#'@examples
20-
#' \dontrun{
21-
#' urlname <- "rladies-nashville"
22-
#' meetup_boards <- get_boards(urlname = urlname)
23-
#'}
24-
#' @export
25-
get_boards <- function(urlname,
26-
verbose = meetupr_verbose()) {
27-
api_path <- paste0(urlname, "/boards")
28-
res <- .fetch_results(api_path = api_path, verbose = verbose)
29-
tibble::tibble(
30-
id = purrr::map_int(res, "id"),
31-
name = purrr::map_chr(res, "name"),
32-
description = purrr::map_chr(res, "description"),
33-
created = .date_helper(purrr::map_dbl(res, "created")),
34-
updated = .date_helper(purrr::map_dbl(res, "updated")),
35-
post_count = purrr::map_int(res, "post_count", .default = NA),
36-
discussion_count = purrr::map_int(res, "discussion_count", .default = NA),
37-
latest_reply_created = .date_helper(purrr::map_dbl(res, c("latest_reply", "created"), .default = NA)),
38-
latest_reply_member_name = purrr::map_chr(res, c("latest_reply", "member", "name"), .default = NA),
39-
resource = res
40-
)
41-
}
1+
#' #' Get the discussion boards from a meetup group
2+
#' #'
3+
#' #' @template urlname
4+
#' #' @template verbose
5+
#' #' @return A tibble with the following columns:
6+
#' #' * id
7+
#' #' * name
8+
#' #' * description
9+
#' #' * created
10+
#' #' * updated
11+
#' #' * post_count
12+
#' #' * discussion_count
13+
#' #' * latest_reply_created
14+
#' #' * latest_reply_member_name
15+
#' #' * resource
16+
#' #'
17+
#' #' @references
18+
#' #' \url{https://www.meetup.com/meetup_api/docs/:urlname/boards/}
19+
#' #'@examples
20+
#' #' \dontrun{
21+
#' #' urlname <- "rladies-nashville"
22+
#' #' meetup_boards <- get_boards(urlname = urlname)
23+
#' #'}
24+
#' #' @export
25+
#' get_boards <- function(urlname,
26+
#' verbose = meetupr_verbose()) {
27+
#' api_path <- paste0(urlname, "/boards")
28+
#' res <- .fetch_results(api_path = api_path, verbose = verbose)
29+
#' tibble::tibble(
30+
#' id = purrr::map_int(res, "id"),
31+
#' name = purrr::map_chr(res, "name"),
32+
#' description = purrr::map_chr(res, "description"),
33+
#' created = .date_helper(purrr::map_dbl(res, "created")),
34+
#' updated = .date_helper(purrr::map_dbl(res, "updated")),
35+
#' post_count = purrr::map_int(res, "post_count", .default = NA),
36+
#' discussion_count = purrr::map_int(res, "discussion_count", .default = NA),
37+
#' latest_reply_created = .date_helper(purrr::map_dbl(res, c("latest_reply", "created"), .default = NA)),
38+
#' latest_reply_member_name = purrr::map_chr(res, c("latest_reply", "member", "name"), .default = NA),
39+
#' resource = res
40+
#' )
41+
#' }

R/get_event_attendees.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#'
33
#' @param id Required event ID
44
#' @param ... Should be empty. Used for parameter expansion
5-
#' @param extra_graphql A graphql object. Extra objects to return
6-
#' @param token Meetup token
5+
#' @template extra_graphql
6+
#' @template token
77
#' @return A tibble with the following columns:
88
#' * id
99
#' * name

R/get_event_comments.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#' Get the comments for a specified event
22
#'
3-
#' @param id Required event ID
3+
#' @template id
44
#' @param ... Should be empty. Used for parameter expansion
5-
#' @param extra_graphql A graphql object. Extra objects to return
6-
#' @param token Meetup token
5+
#' @template extra_graphql
6+
#' @template token
77
#' @return A tibble with the following columns:
88
#' * id
99
#' * comment

R/get_events.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#' Get the events from a meetup group
22
#'
3-
#' @param urlname Required urlname of the Meetup group
3+
#' @template urlname
44
#' @param ... Should be empty. Used for parameter expansion
5-
#' @param extra_graphql A graphql object. Extra objects to return
6-
#' @param token Meetup token
5+
#' @template extra_graphql
6+
#' @template token
77
#' @export
88
get_events <- function(
99
urlname,

R/get_members.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#' Get the current meetup members from a meetup group
22
#'
3-
#' @param urlname Required urlname of the Meetup group
3+
#' @template urlname
44
#' @param ... Should be empty. Used for parameter expansion
5-
#' @param extra_graphql A graphql object. Extra objects to return
6-
#' @param token Meetup token
5+
#' @template extra_graphql
6+
#' @template token
77
#' @return A tibble with the following columns:
88
#' * id
99
#' * name

0 commit comments

Comments
 (0)