I have some future plans for these pages, of course!
I wasn't sure if they were going to include the UK raffle number in the Saturday night video, but they did. After entering it manually into the appropriate data file tonight, I've updated my video transcription script to insist that at least one UK raffle number is included as a parameter after the UK main Lotto drawn-order balls. Rather than manually add a newsflash to announce that winning numbers were available after I'd run the transcription script, the script itself now adds a newsflash automatically.
In case you're wondering about all this flurry of activity, the plan is to have two sets of updates that I'm trying to wring all the bugs out of. The first one is a manual one based on the official YouTube videos - I get e-mail alerted if they turn up before the official site's text version of the numbers (which they almost always do). Once I know there's a new video up (though I can anticipate the times from previous weeks of course), I go to the YouTube video, freeze it on the full set of drawn order balls and those will be the initial parameters to my updating script. If it's the main Lotto or Euro Millions, I then jump the video to the caption of the raffle tickets and add those as parameters to the script, which I then run to update data files/pages.
The second set of updates are done by scraping scripts that have run for years now and they grab the full results (winning numbers, prizes, winners, ticket sales if available, raffle tickets etc.) for Thunderball, HotPicks, Euro Millions and main Lotto. These are quite complex scripts and have to be occasionally maintained (bugs fixed, site being scraped changes its HTML, draw rule changes etc.). Having a second set of updates means that if I miss the first manual udpate, the second update will cover everything - and more - that the first update missed.
Interestingly, although tonight's "streamed live" video was a combined one with both the main Lotto and Thunderball draws, it looks like Camelot split them off at 8.56pm! The main Lotto video stayed at the same combined video URL (but was just the main Lotto draw) and a fresh video URL was created just for the Thunderball draw. Impressively, my YouTube scanning code detected all of this and re-generated the pages to include the new Thunderball solo video URL.
It does look like I'll be busy every draw night (Tue, Wed, Fri and Sat) from 8.00pm or so onwards because the official YouTube videos do appear well before the winning numbers turn up "textually" on Camelot's official site. I've now written a script that takes the latest draw balls in drawn order (and the Millionaire Maker winning numbers if it's the Euro Millions), updates the appropriate data file/code and re-generates the pages. I'll be using this to quickly manually transcribe the numbers from the official video (if I've auto-scraped the numbers already from an official site, it will tell me this and not do anything).
Although the individual Thunderball draw page and the Thunderball index page were updated with the new video link, I'd not actually coded the Thunderball video link for the home page yet. That's been fixed now, so for the first time, the home page has three video links on it - yay!
At least tonight's Euro Millions official video appeared in a more timely manner - apparently "streamed live" at 9.19pm. Unfortunately, I didn't pick up the numbers from the Irish official site until just after 9.20pm and the video cron job was run at 9.20pm (no winning numbers) and 9.30pm (had the winning numbers, so could grab the video link as well then). I've adjusted the cron jobs so that they're run every 5 minutes now until 9.58pm, so I should get the video link up possibly 5+ minutes earlier in the future.
One thing I've not commented on are the official YouTube videos themselves. Up until last Saturday, they've been using the BBC TV footage for the main Lotto and Thunderball Saturday draws, but that will presumably have to change to the "off-air" Wednesday draw video format from now on.
In fact, if you look at the Wednesday draw videos, you'll probably have sussed something already about them - namely that Alan Dedicoat's voiceover is pre-recorded as samples ("one", "two" and so on) and then pieced together for the full commentary. I hope he gets repeat fees even though he's not there for the actual draw :-)
It's also a bit lazy of Camelot not to have Alan's voiceover reading out the Millionaire Raffle number. I mean, they just needed the 12 colours sampled ("Aqua", "Blue" etc) and maybe "zero" too (since that's not a possible lottery ball, but can be part of a raffle number).
Despite not having a Facebook account, I was still curious about the upcoming Facebook Live "lottery show" and sure enough, there's a Camelot press release on it. However, it doesn't mention Thunderball, Euro Millions or indeed any other day than Saturday, so exactly which draws Facebook Live will cover is still somewhat undefined. If it just does the Saturday main Lotto, then that's only 14% of the possible live draws they could cover! Also, I'm not sure if you do indeed need a Facebook account to view the live videos - if you do, that's pretty bad.
Whilst iPlayer does indeed put up the TV show video quickly, they only keep 30 days' worth (hopeless!) and of course, you have to skim through it to find the actual draws because there tends to be padded guff in there.
I don't have a Facebook account, so Facebook Live - when it launches soon - probably will be useless for me. That leaves YouTube as the best of the bunch because it goes back years, though there's plenty of gaps if you load and load and load their video listings page (why isn't there a "View All" option?!).
So what I needed to do was to get the draw date for each video and convert it into a draw number (slightly tricky, but I have a day offset from draw 1 in my data files for each draw, so it was doable) and then extract the YouTube viewing URL for the video.
The first pass for this was to load the entire HTML for all the videos in my browser (Load More clicked about 50 times!), select all the page with Ctrl-A, view selection source and then Ctrl-A again and finally paste it into a text file. The things you have to do to get around dynamically loading pages! This resulted in a 5.4MB HTML file, which I used as a starting point to generate three data files (main Lotto, Thunderball, Euro Millions) containing the draw numbers and viewing URLs.
If I just load the main Videos page via curl instead, I just get the latest videos only, which is fine because I can then uniquely merge that with the historical list to get an updated list. Not much left to do but write some code that, given a draw number for one of the three draw types would open up the appropriate data file and look for the draw number and viewing URL. If if found one, it would return a text/hyperlink string that can be embedded on the page (at the end of the draw date was the easiest place).
A cron job is now running every 15 minutes on draw night (I'm running for the whole of today as well because the latest draw videos for last night aren't up yet - sluggish Camelot!) that will run the script that updates the draw number/viewing URL list (though it doesn't yet force a page re-generation, which it probably should). I also re-regenerated all the individual lottery pages for the three draw types so that the video link appeared on every page that had an accompanying YouTube video.
It will be interesting to find out exactly when Camelot update their YouTube video and if it's at a consistent time gap relative to the draw taking place. I am wondering if I should fall back to the iPlayer video if the YouTube one isn't available yet for the latest draws, but I need to see what iPlayer does on Saturday 7th January once the Saturday draws are done - will they put them online as soon as they've taken place and will they be in a new location URL-wise because they're no longer programmes aired on a BBC channel?
Spent a bit more time during this New Year's morning improving the YouTube video script. It now no longer grabs a fresh copy of the list (or indeed do anything) if the video list is up-to-date. Next, it re-generates the appropriate pages with new video links if there are new video links in the latest list.
Finally, I added more cron jobs to run it: every 5 mins on draw nights between 8.30pm and 8.55pm, every 10 mins on draw nights between 9.00pm and 11.50pm and every 15 minutes every day between 12.00am and 7.45pm. In case you think the last schedule is over the top, well it's been over 12 hours since the draws took place last night and still Camelot haven't put the latest videos up for them!
Previous month: December 2016