Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Gets a list of meetup RSVPs using the meetup API.
function Get-MeetupRsvps([string]$eventId, [string]$apiKey) {
$nameWord = "[\w-']{2,}"
$regex = "^(?'first'$nameWord) ((\w\.?|($nameWord )+) )?(?'last'$nameWord)|(?'last'$nameWord), ?(?'first'$nameWord)( \w\.|( $nameWord)+)?$"
function Get-AttendeeInfo {
process {
$matches = $null
$answer = $_.answers.answers_item
if(-not ($_.name -match $regex)) { $answer -match $regex | Out-Null }
return New-Object PSObject -Property @{
'FirstName' = $matches.first
'LastName' = $matches.last
'RSVPName' = $_.name
'RSVPAnswer' = $answer
'RSVPGuests' = $_.guests
}
}
}
$xml = [Xml](New-Object Net.WebClient).DownloadString("https://api.meetup.com/rsvps.xml?event_id=$eventId`&key=$apiKey")
$xml.SelectNodes('/results/items/item[response="yes"]') | Get-AttendeeInfo | select FirstName, LastName, RSVPName, RSVPAnswer, RSVPGuests
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.