Skip to content

Commit

Permalink
Add verba.civio.es library
Browse files Browse the repository at this point in the history
  • Loading branch information
rubiojr committed Oct 8, 2024
1 parent 288b44c commit bed8f4d
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions lib/verba.risor
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* verba.civio.es client library.
*/

const _VERBA_URL = "https://verba.civio.es/api"

func _get(path, opts) {
return fetch(_VERBA_URL + path, opts)
}

func programmes() {
resp := _get("/fetchProgrammeList", {})
if resp.status_code != 200 {
error("error fetching programmes")
}

return resp.json()
}

func transcription(programme_id) {
resp := _get("/fetchProgrammeTranscription", {params: {programme_id: programme_id}})
if resp.status_code != 200 {
error("error fetching transcription")
}

return resp.json()
}

0 comments on commit bed8f4d

Please sign in to comment.