"joined" date for membership in groups
Closed this issue · 8 comments
I have been working a little with getting some dat for a presentation, and I realised that the "joined" date, as retrieved by the get_members()
function, is the date a person joined meetup, not the date they joined the group.
We might not have the date of joining group (I'm looking into the resource we get and see if I can parse it out), but i'm writing it down here so checking this is not forgotten.
And perhaps the "joined" column should be renamed to "joined_meetup", and if we find group joining, it could be named "joined_group"?
we discussed it here: #20
i found a solution last year, but now that solution is no longer working.
@orchid00 Did you know that the meetup package has changed since then and now uses OAuth instead of a personal API key? I just want to check if that's the reason your solution is not working (instead of some other reason).
@Athanasiamo In general, we don't want to change any of the field names from what Meetup API calls them (unless it's a real bug on their end, which we should probably tell them about and see if they can fix it on their end). One solution (if she can get it working again) is to create our own custom column created from @orchid00's mutate
code?
hi @ledell thanks for your comment. So, I was trying this yesterday, I have many questions. I tried a lot of things....
First, yes I noticed the OAuth updates, It all worked well it asked me to login, and the get_events
function works perfectly well.
Second, I used code from august last year, and since then, R versions have been updated, now I have 4.0.0 but meetupr was not available for this newer version, so i'm still using meetupr v 0.2.0 (not really sure if there's a newer version).
Third, the little issue I encountered with the get_members
function is... a list of lists, but really a bunch of lists. Maybe I just couldn't figure out how to open all of those.
For context, before (last august) it was one list inside another list (something like)>> resource$group_profile.joined
Now the date is buried somewhere in a bunch of list.... I am guessing some map
addition is needed in line 42 from here: >>> https://github.com/rladies/meetupr/blob/master/R/get_members.R code resource = res
whereas all the other columns have a map()
Maybe something changed in the API and now they have much more information that's all being condensed in the list-of-lists column called resource
.
resource$(unnamed list)$group_profile$created
I don't know how to access it if I don't know the name of the list.
I tried this code
members <- get_members("YOURGROUPNAME")
a <- members[1,]$resource # just to pick the first row, to select one person.
b <- a[[1]]$group_profile$created ## the [[1]] the first list is unnamed
I don't know how to access an unnamed list in other ways, I tried tidyverse.... but only brackets will give me the list :( Then, as before, there's the list group_profile
and in there is the created
. <<<< that's the one that has the date when a member joined the group! I found it! I just couldn't get to extract it for the whole table. tearing eyes HELP?
that b
is a 13 digit number which can then be translated to the date using lubridate::floor_date(as.POSIXct( b/1000, tz = "UTC", origin = "1970-01-01"))
From what I see meetup is using api2. I'm a bit ashamed that I ended up getting the data through manual scrapping from here: https://api2.meetup.com/<YOURGROUP>/members/
i don't have enough knowledge to get the json file because I don't know where to authenticate if I do it manually (blush blush blush). In any case, I got the dates through a very fiddly way.... there must be a better way to do this!!
I hope I shared some light into the problem and someone could help me fix it.
@orchid00 EDIT: This line added to get_members.R acquired the join date of a group member. Thanks for the tip!
created = .date_helper(purrr::map_dbl(res, c("group_profile", "created"))),
ADDED: I am using meetupr version 0.2.0 in R 3.6.1.
Hey @orchid00 I don't have time to look at this right now, but I can try to look at it in about 2 weeks when I am done writing a paper. Please ping me on here in 2 weeks if you want me to get my attention again to take a look. :-)
One quick question -- you said the following:
now I have 4.0.0 but meetupr was not available for this newer version
Does meetupr not work on R 4.0.0? If so, would you be willing to file an issue with more information (and error messages)? Thanks!
The following is not a meetupr bug but a Meetup API bug: Placing this here before I forget, while working on this code for a presentation, I discovered that the argument "past" causes the Meetup API to return a future event if, as best as I can tell, the event has been rescheduled from a prior date to a future date.
Note: Getting the list of attendance records for private groups is limited only to members of that group.
past_events <- get_events("tripass", "past") %>%
dplyr::filter(year(created) %in% c(2018, 2019, 2020)) %>%
select(id, name, local_date)
tail(past_events, 1)
returns as of 5:30 AM Eastern on 6/30/2020:
# A tibble: 1 x 3
id name local_date
<chr> <chr> <date>
1 271083890 Excel Workbook Creation and Formatting in R by Rick Pack 2020-06-30
This causes get_event_attendees to fail with a 400 error:
get_event_attendees("tripass", "271083890")
[1] "https://api.meetup.com/tripass/events/271083890/attendance"
Error in .quick_fetch(api_url, event_status = event_status, ...) :
Bad Request (HTTP 400).