-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added fields
to find_groups()
to retrieve optional fields from M…
#48
Conversation
…etup API find/groups method within the Meetup API has several optional fields that are not returned by default. They will be returned when you pass them to the `fields` attribute as part of your API query. This functionality is now provided within meetupr. In meetupr, after the query, these fields can then be retrieved from the `resource` tibble attribute already defined in find_groups().
|
@benubah This looks like a nice usability feature. I think if we are going to add something like this, it would make sense to add it to all our functions... what do you think, @LucyMcGowan? It also may make sense to call it something like |
This looks good! I am torn on whether it should be called |
@benubah @LucyMcGowan I am noticing now that this is an actual parameter in the API (I thought it was just made up parameter for extra usability), so I understand now why it was named It's a bit confusing because there's no way for the user to know in advance what extra fields they want unless they carefully read the API docs... would it make sense to hard-code the extra field options so the user is not digging into API docs to use the parameter effectively? e.g. Trying out an example (without using
Here's what we return in our tibble:
And here are the remaining fields available by default in the
|
One option could be to include a link to the API docs directly with a list of potential fields (if such a thing exists) in the docs about this new parameter |
@benubah Here's what I suggest -- let's leave |
R/get_events.R
Outdated
@@ -9,7 +9,7 @@ | |||
#' * proposed | |||
#' * suggested | |||
#' * upcoming | |||
#' | |||
#' @param fields Character or characters separated by comma (e.g "event_hosts" or "event_hosts, past_event_count_inclusive"). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried passing "event_hosts, past_event_count_inclusive"
and it did not work... I don't see "past_event_count_inclusive" on the list of additional fields: https://www.meetup.com/meetup_api/docs/2/events/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for reviewing this. The additional fields are stored in resource
- last attribute in the tibble, so the following works for me:
urlname <- "rladies-ames"
#get past meetings of a single group
past_meetings <- get_events(urlname = urlname, event_status = "past", fields = "event_hosts, past_event_count_inclusive", api_key = api_key)
# get events hosts of single past meeting
single_event <- past_meetings$resource[[1]]$event_hosts
These additional fields are not available in v2 of the meetup API. You can see them in v3 here: https://www.meetup.com/meetup_api/docs/:urlname/events/#list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The past_event_count_inclusive
field is not returned:
> names(past_meetings$resource[[1]])
[1] "created" "duration" "id"
[4] "name" "date_in_series_pattern" "status"
[7] "time" "local_date" "local_time"
[10] "rsvp_close_offset" "updated" "utc_offset"
[13] "waitlist_count" "yes_rsvp_count" "venue"
[16] "group" "link" "description"
[19] "how_to_find_us" "visibility" "pro_is_email_shared"
[22] "event_hosts"
> past_meetings$resource[[1]]$past_event_count_inclusive
NULL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you able to see it in your results? I see that it's listed in v3 docs but not v2 so I wonder if that's causing some issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I don't see past_event_count_inclusive
. This looks like a problem from within the API itself, because, I tried group_past_event_count
and it returned a value under group
list in resource
.
past_meetings <- get_events(urlname = urlname, event_status = "past", fields = "event_hosts, group_past_event_count", api_key = api_key)
names(past_meetings$resource[[1]]$group)
So I guess, it would be better to take out past_event_count_inclusive
for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where the optional fields
parameters are in the range of 30 - 40 different parameters for get_events()
, would you like to hardcode say, all 40 parameters in the fields
description? I see that the parameters are many in v3.
Another thing to decide on -- right now, if you want to get multiple fields, you pass a single comma delimited string. In R, people would be used to passing a character vector with multiple string values... so which input type is better? Current:
Other option:
Or we can support both. |
@ledell @LucyMcGowan Thank you for looking into this. I will look into all the concerns raised and will feedback soon. |
Yes, I have now added support for both. |
@ledell Could you please look into this: " where the optional |
Feel free to use your judgement on this one... I think you're right that 30-40 params would be too much for the docs. Maybe if there are >10, we should just reference a URL that lists them? |
…gle string of comma separated values
I am presenting about this work as one of the Google Summer of Code 2019 mentors on Tuesday, October 22, 2019. Might someone give me a quick comment about the current status that helps one understand why Ben's work has not yet been merged into the main meetupr repo? I see there are conflicting files. |
Hi @benubah and @RickPack -- sorry for dropping the ball on this. I was low on bandwidth at the time we were having this conversation, but I am revisiting some of the outstanding meetupr tasks this week. It looks like the conflicts are related to the OAuth changes made in Aug 2019. Would one of you be able to fix the conflicts? Once these are fixed, we can get this merged into the package! The other topic that never got fully resolved was whether it was better to name the parameter something more accurate (like |
I am using the meetupr package for a Tuesday presentation and will look at this over the weekend.
Tuesday presentation = TriPASS Data Science: Using the meetupr Package
http://meetu.ps/e/JqlKk/2MGw5/a
… On Oct 6, 2020, at 6:42 PM, Erin LeDell ***@***.***> wrote:
Hi @benubah and @RickPack -- sorry for dropping the ball on this. I was low on bandwidth at the time we were having this conversation, but I am revisiting some of the meetupr stuff this week.
It looks like the conflicts are related to the OAuth changes made in Aug 2019. Would one of you be able to fix the conflicts? Once these are fixed, we can get this merged into the package!
The other topic that never got fully resolved was whether it was better to name the parameter something more accurate (like extra_fields), or whether to just re-use the "true" name, fields. I am ok to keep to the "true" name -- anyone else have final thoughts on that?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Hi @RickPack that's great! If you have time to resolve the conflicts over the weekend, then I can merge it as soon as you tell me you're done. Thanks! |
EDIT: Ben, do you mind if I submit a PR that just takes the current meetupr code and adds:
1) Ben's edit to R/internals.R loops the same function used previously (quick_fetch, not modified by
Ben).
2) Ben's edit to R/find_groups.R simply enables the fields and topic_id objects to be multi-length vectors.
Or you can do so and scrap this PR. I am not sure if the merge will cause the loss of edits like the ellipses in the following from internals.R as well as the elimination of the api_key argument (see merged GregSutcliffe@59d2b6c)
res <- .quick_fetch(api_url, event_status = event_status, ...)
I have not worked with Github in this collaborative way in many months.
|
Also @benubah please add your name in the DESCRIPTION file as a contributor to the package ( |
I also emailed @benubah and have not heard from him. I think I'll have time
Sunday to convert his work into a new PR and credit him as you described.
…On Thu, Oct 15, 2020 at 2:01 AM Erin LeDell ***@***.***> wrote:
Also @benubah <https://github.com/benubah> please add your name in the
DESCRIPTION file as a contributor to the package (role = "ctb")! I'd love
to get your three PRs merged soon.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#48 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAVDF43QLQNL6PA357O6TCTSK2F2NANCNFSM4HRWNJWA>
.
--
Regards,
Rick Pack
Email: [email protected]
LinkedIn: https://www.linkedin.com/in/rick-pack-mappstat-5320387/
|
Merge branch 'patch-1' of https://github.com/benubah/meetupr into patch-1 # Conflicts: # DESCRIPTION
All fixed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @benubah!
I added
fields
tofind_groups()
to retrieve optional fields from Meetup APIThe find/groups method (https://www.meetup.com/meetup_api/docs/find/groups/ ) within the Meetup API has several optional fields that are not returned by default.
They will be returned when you pass them to the
fields
attribute as part of your API query. This functionality is now provided within meetupr. In meetupr, after the query, these fields can then be retrieved from theresource
tibble attribute already defined in find_groups().