Digital HUAC Update

A short update today, as we continue to push forward on getting our search functional. We’re stalled out on a few specific questions that are, hopefully, the final barriers in putting it all together. We’ve reached out to the digital fellows and a few other people we hope can help us on these questions–

-What is the best way to connect to a REST API? Our code is currently configured using curl. Is that the best approach?

-What is the best way to structure our search in JSON—using a list (with indexed search results by location) or using an associative array of key-value pairs? We have created key-value metatags for our documents in DocumentCloud, but the resulting JSON search results only display the built-in metadata tags (e.g., title: “”, id: “”) and not our created metadata tags. Is that an issue on the DocumentCloud or on the coding side?

We’ve added a bunch more testimonies to our DocumentCloud group, and have started on entering the metadata for it. The writing and outreach process continue to move forward, along with some of the smaller aspects of UX and development.

1 thought on “Digital HUAC Update

  1. Amanda Hickman

    Some answers:

    * Yup, curl is a fine way to go about pulling the JSON. There are other good ways, including file_get_contents() but there’s no good reason to use one over the other in your case.

    * PHP’s “associative arrays” are what Python calls a dictionary, and you definitely want to convert the JSON into an associative array in PHP so you can work with it.

    I’m not entirely sure that I understand the problem you’re having with your custom key/values. Are you asking how to access them with the API? Can you give an example of a query that you expected to work? What were you expecting you would get, what did you get, what should have been included?

    If you’ve asked DocumentCloud directly for support, please do cc me so I can help make sure you get answers!

    Glad to see you all making great progress!

Comments are closed.