Created
April 4, 2015 21:37
-
-
Save samklr/f3cceafa9df0d770147e to your computer and use it in GitHub Desktop.
Curling meetup attendees lists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
#add in your meetup.com API key here | |
local key | |
key= | |
#add in your event ID here | |
local event | |
event= | |
local json | |
json=$(curl -f -s -S -k https://api.meetup.com/2/rsvps\?\&key\=$key\&photo-host\=public\&rsvp\=yes\&event_id\=$event\&fields\=member&page=1) | |
local rsvps | |
rsvps=$(echo $json | jq -r '.results[].member.name') | |
local names | |
names=$(echo $rsvps | awk 'BEGIN { OFS = " "; ORS="\n"} { if ($2 == "") print $1, "Guest"; else print $1, $2}') | |
print $names |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment