Resolve a crid

See Project Baird (spec) for an explanation. It currently works only for BBC content, and in some cases only for the West regional variations. It's not yet complete with respect to the specification. You can find crids from newer versions of MythTV (programid in the program table). They are not the same as the crids in the BBC backstage data

Example queries using curl are below or you can use the form to resolve a crid.



Examples using Curl


If a url that's a crid is present, just go ahead and look up that, resolve to /programmes episode url.

curl "\[\]=crid://"

if you don't set the format using the accept header or fmt=rdf it resolves to the html version of the page. For RDF, you could equally use:

curl -H 'Accept: application/rdf+xml'

The same but following the redirect

curl -L "\[\]=crid://"

Result: 301,

Dvb urls

If there's no crid, if there's a dvb url in the query, look up that, resolve to programmes

These follow the format: dvb://<original_network_id>.<transport_stream_id>.<service_id>;event_id~start-time--duration

curl "\[\]= &fmt=rdf"

Result: 301,

Host and start time

If there's no dvb url and if the host header is present and matches the TVDNS format, and start is available as a parameter, resolve to programmes

curl -H "Host:" ""

Similarly, a transmisisonTime can be set, including defauling to now:

curl -H "Host:" ""

Eventid and Serviceid

If crid, dvb urls and start are not available, but eventid and serviceid are both present as parameters, resolve to programmes

curl ""

Result: 301,

No Redirect

If you don't want it to redirect use noredirect=true as a parameter:

curl "\[\]=crid://"

Programmes and Pips

These do not resolve, but just return the crid and dvb urls if available. Note that only episodes will resolve.

Example of a working programme Episode url

curl "\[\]="

Example of a tag url

curl "\[\],2008:PIPS:b01dtlw7"

How it works

How it works now

A mini crawler runs nightly, grabbing the schedule and programmes schedule data from /programmes for that day in json. A crontab dumps todays' data from a patched version of MythTV created by Mo. I put all this in a tiny mysql database and a number of simple join queries are made to answer the resolving queries.

It used to use the /programmes RDF data and do various Sparql queries on the merged data to attempt to respond to requests, but I decided that was overkill.

The code

The code is in github. It's fairly involved to set up and the documentation isn't complete - but these are very simple and work without setting up any RDF server, and could trivially be rewritten in python or whatever:


and you could easily implement the rest of it it without using RDF at all.

If you don't want to patch MythTV you can still get everything except the eventids - use exportdata.rb

Todays's crids

Are here.