Extracts the programcard URN from a dr.dk url
npm install denmark-dr-programcard
const programcard = ;
Given a popup url, this module will extract the programcard URN. This is an id you can use to get more information about the specific program.
First step is usually to make a REST request to
See http://www.dr.dk/mu-online/Help/1.3 for the full documentation.
const href = '';
DR.dk provides a poorly documented but public API at http://www.dr.dk/mu-online/Help/1.3 . ProTip: there is a version 1.3 of the API, but you will be redirected to version 1.2. Unless you explicitly set it in the URL.
Much of this API is based on specific IDs, and these IDs are hard to obtain form
a friendly url. But in the HTML source code of the popup url (and possibly other urls),
there is a
<script> tag that sets a
window.DR object. From this
programcard URN can be extracted. Using the programcard URN many of the other related
IDs can be obtained.