Skip to content

Instantly share code, notes, and snippets.

@ecki
Forked from anonymous/openantrag-j2c.ps1
Last active December 24, 2015 01:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ecki/6725537 to your computer and use it in GitHub Desktop.
Save ecki/6725537 to your computer and use it in GitHub Desktop.
#
# This will format http://openantrag.de/api/proposal/ID/gettop/100 JSON files into CSV
#
$list = @()
foreach($file in Get-ChildItem -Filter proposal-*.json .) {
$list += ((Get-Content -Encoding UTF8 $file) -join "`n" | ConvertFrom-Json)
}
# Inspect Result graphically: PS1> $list | Out-GridView
# Inspect Possible Columns: PS1> $list | Get-Member
# See full Object: PS1> $list | fc -Depth 3
$list | select Key_Representation, Id, Title, CreatedAt, ID_CurrentProposalStep, IsAbuse | ConvertTo-Csv > file.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment