Last active
December 21, 2015 13:29
-
-
Save drmohundro/6312996 to your computer and use it in GitHub Desktop.
Simple PowerShell script to pull the DevLink agenda.
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
# NOTE: Only worked for DevLink 2013 | |
$agenda = Invoke-RestMethod http://www.devlink.net/agenda.json | |
$speakers = Invoke-RestMethod http://www.devlink.net/speakers.json | |
$location = Invoke-RestMethod http://www.devlink.net/api/info/locations.json | |
$fullAgenda = $agenda | foreach { | |
# normalize the times to be datetime types | |
$startTime = ([DateTimeOffset]::Parse($_.start_time)).DateTime | |
$endTime = ([DateTimeOffset]::Parse($_.end_time)).DateTime | |
$entry = $_.entry | |
# speaker lookup | |
$foundSpeaker = $speakers | where { $_.id -eq $entry.speaker_id } | |
$foundRoom = $location | where { $_.id -eq $entry.location_id } | |
$speaker = '' | |
if ($foundSpeaker -ne $null) { | |
$speaker = $foundSpeaker.name | |
} | |
[PSCustomObject] @{ | |
Title = $entry.title; | |
Speaker = $speaker; | |
Summary = $entry.summary; | |
Location = $foundRoom.name; | |
StartTime = $startTime; | |
EndTime = $endTime; | |
} | |
} | |
$fullAgenda |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is just something I threw together to help me get the sessions so that I could plan out my trip. Oh, and it was totally unnecessary.
Just drop it in a folder and run it. Writing a module would have been overkill for this.
Example usage:
Sample (trimmed) output: