If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
There's been a bit of a problem this week: the internal format of the BBC schedule page has changed quite radically, so I'm having to re-write my code to read it. I'll post an update later as to whether I've succeeded or given up
They do that, don't they?
It isn't given us to know those rare moments when people are wide open and the lightest touch can wither or heal. A moment too late and we can never reach them any more in this world.
thanks for your continuing efforts.
They have been and are much appreciated here.
If you want a second technical eye on the biz
- do let me know what the internal format now looks like.
I was whizz at the xml/xsl versions way back when.
Originally posted by Forget It (U2079353)View Post
Hi Andrew
thanks for your continuing efforts.
They have been and are much appreciated here.
If you want a second technical eye on the biz
- do let me know what the internal format now looks like.
I was whizz at the xml/xsl versions way back when.
Thanks for the offer - I'm nearly there now; it just needs more programming time. The xml version is long gone. Up until last week I've been 'scraping' the html code, but they've moved the details to an ld+json script section towards the end of the schedule file. I've managed to decode it in a stand-alone bit of php code, and now just need to integrate it into the existing code (and find a way of automatically reading the start and end times to allow for DST - hopefully trivial - although it's not desperate yet, as I have until the end of October to fix that!)
For what it's worth, here's a summary of today's schedule:
start: 2018-09-15T00:00:00+00:00
end: 2018-09-15T06:00:00+00:00
Through the Night
Up until last week I've been 'scraping' the html code, but they've moved the details to an ld+json script section towards the end of the schedule file. I've managed to decode it in a stand-alone bit of php code, and now just need to integrate it into the existing code (and find a way of automatically reading the start and end times to allow for DST
Um, well … if you need any help …
It isn't given us to know those rare moments when people are wide open and the lightest touch can wither or heal. A moment too late and we can never reach them any more in this world.
Thanks for that - yes, there's an ld+json script section in there, but it covers Mon-Sun whereas my list covers Sat-Fri. It's not a problem as my code loops through the 7 day files. Or have you found a pure json version of the webpage? I can only find them for the programme pages, e.g.https://www.bbc.co.uk/programmes/m0000d1k.json and the playlists: https://www.bbc.co.uk/programmes/m0000d1j/segments.json. (They're both readable in Firefox.)
I've glanced through it and it seems to be OK, but please let me know if you spot any 'features'.
I'm hoping things will go all right on the server next week, and on 28th October and 31st March when the clocks change, but we'll see.
I just need to do the same for the playlist generator code before next Saturday morning. (This morning's playlist run was OK because it used the files downloaded last week which were of course in the old format.)
I think I've made the final change for the time being, which involved putting the subtitles in the opposite order to that deemed correct by the BBC. e.g. in CotW I have put the composer's name in the first subtitle, with the edition (episode) subtitle last. This also seems to fit better in programmes which have series and episode in separate subtitles. For some reason the BBC thinks it should be the other way round
This contains an on-line version; the pdfs may be downloaded (after they have been auto-generated shortly before 9.30pm on a Friday) by hovering the mouse over the 'pdfs' button and either left-clicking on the appropriate file to display it, then downloading through the pdf reader, or by right-clicking on it and 'saving as'.
An archive is now being built up on the new website - see the 'archive' button. (Note that the listings for the first two weeks are test versions and aren't complete.)
Printer - friendly html versions are available via the 'print-friendly' button, the download or display procedure is as for the pdfs detailed above.
Note that the online version now lands on the current programme; to read next week's list early, use the 'Archive' drop-down list.
(All went without a hitch: I got distracted so couldn't post immediately.)
Comment