Github API examples & templates
Use these vals as a playground to view and fork Github API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
tmcw
uuidExample
Script
uuid The uuid module provides builders for different types of universally unique identifiers . These are kinds of identifiers that you can use instead of auto-incrementing integers. They're intended to contain so much randomness that the chances of a collision between two uuids is very low. There are different versions of uuids available: typically people use v4 UUIDs, which are fully random.
0
tmcw
qsExample
Script
qs QS is a pretty old module that you probably shouldn't use but it's still pretty heavily used. In the very very early days there wasn't a built-in way in JavaScript to parse querystrings. So QS was born. But then, Node.js added a querystring module built-in. Then, JavaScript introduced URLSearchParams , which you should use whenever you want to parse or generate query strings.
0
sammeltassen
rijks
HTTP
IIIF Presentation API for the digital collections of the Rijksmuseum . This val accepts requests in the form of: https://sammeltassen-rijks.web.val.run/[identifier] You can locate the identifier under "Persistent URL" at the bottom of an object page on the Rijksmuseum website, e.g.: Persistent URL: https://id.rijksmuseum.nl/200738982 Request: https://sammeltassen-rijks.web.val.run/200738982 The val first requests a machine readable representation of the object's metadata. For more information, please refer to the Rijksmuseum Data Services . The edm profile contains a pointer to the IIIF Image API Enpoint hosted at Micrio . For debugging you can request the raw edm response (converted to json) as follows: EDM response: https://sammeltassen-rijks.web.val.run/200738982?format=edm The val checks if the objects has additional parts, and fetches the information for those parts as well. This will slow down the val for large objects! It then passes this on to IIIF Builder with some metadata to create a IIIF Presentation Manifest. Some objects with many parts for testing: Kaart van Delfland Kaart van het Hoogheemraadschap van Delfland ( alternative ) Plattegrond van de Kaart Figuratief van Delft Kaart van het Hoogheemraadschap van Rijnland Les Forces de l'Europe, Asie, Afrique et Amerique en Les costes de France et d'Espagne Album met de kaart van de stad Rotterdam NB: Unfortunately, not all objects include pointers to the IIIF image. This is for example the case for the The Night Watch (id: 200107928 ). In such cases, a manifest is returned without canvasses. Todo: Add more metadata to manifest Cache responses? https://www.val.town/v/xkonti/cache https://docs.val.town/troubleshooting/migrating-deprecated-http-vals/#intentionally-caching-values-for-performance
0