Skip to content

Instantly share code, notes, and snippets.

@pfcoperez
Last active March 2, 2022 14:15
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 pfcoperez/da2f155485bfcb1d730bc39c27ef98d1 to your computer and use it in GitHub Desktop.
Save pfcoperez/da2f155485bfcb1d730bc39c27ef98d1 to your computer and use it in GitHub Desktop.
# https://www.europarl.europa.eu/plenary/en/votes.html?tab=votes
curl https://www.europarl.europa.eu/doceo/document/PV-9-2022-03-01-RCV_FR.xml |\
xq . |\
jq '."PV.RollCallVoteResults"."RollCallVote.Result"[] | {"description": ."RollCallVote.Description.Text"."#text", "votes": ."Result.Against"."Result.PoliticalGroup.List"[]}'
cat /tmp/votes.json | jq '."PV.RollCallVoteResults"."RollCallVote.Result"[] | select(."RollCallVote.Description.Text"."#text" == "- Après le § 37 - Am 21")| {"description": ."RollCallVote.Description.Text"."#text", "votes": ."Result.For"."Result.PoliticalGroup.List"[]}' | jq '.votes | ."@Identifier", (."PoliticalGroup.Member.Name" | length)' -r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment