!Teletext Script
Annotated version of '!startup'

 

For the lastest !startup script (with keypress modifiers, etc), look in the Scripts directory of the !Teletext v1.52 update.

 

First, some comments.

; Teletext "!startup" script.
; The current version of Teletext does not ask if you'd like to run
; this script, upon startup. The next version probably will.
; If you don't want to be bothered by that, don't call it "!startup".
Now, select channel 5 and force a poll to let the hardware catch up.
; select satellite decoder
channel(5)
poll_now()
Ask the user to select CNBC.
This could be made friendlier by embedding the 'Please change channel' inside an if() construct upon a non-match. In this case, the user will not see the message if the user is already tuned to CNBC.
All this rubbish is necessary for devices which output multiple 'channels' on one UHF channel, such as satellite receivers, cable boxes, and so on.
; we want to receive CNBC (channel 2 on my satellite decoder; 10,732 Vertical, Analogue PAL)
.isitcnbc
message("Please set satellite receiver to CNBC (channel 2)")
channelid(A)
if (A ! &714E) go("isitcnbc")
What we want from CNBC is Jay Leno's guest list and Conan O'Brien's guest list. Frankly, they're the only things worth watching on CNBC. The teletext is sparse (can't they pipe through some stuff from MSNBC?) and the majority of the programming is boring stock market stuff, a lot of which is presented by a wide-eyed girl that looks like she's had a dozen coffees too many in the past hour...
; Jay Leno's guest list, and Conan's guest list
getframes(182)
getframes(183)
Now, we want CNN.
; now we want to receive CNN (channel 1 on my satellite decoder; 11,627 Vertical, Analogue PAL)
.isitcnn
message("Please set satellite receiver to CNN (channel 1)")
channelid(A)
if (A ! &804F) go("isitcnn")
Similar to the BBCnews scripts, we want to snarf pages 101 to 110 (inclusive). Unlike the BBCnews scripts, we'll just toddle on and get 'em one by one. CNN ain't fast, but as we are a little background task, it's no rush.
If you're a speed demon, then feel free to patch in parts of the BBCnews scripts. You oughta be able to get this in about three passes.
But, then, reflect on life. You should eat more stuff cooked in olive oil; and you need get up from your computer for only two reasons - to go to the toilet and to get more beer. Unless you're a med student in which case people should bring you beer, and you can feel free to wet yourself as you'll get forty seven interesting (but unlikely) explanations for why it happened.
Either way, life's too short to worry about whether these pages will be pulled in three minutes, or two.
; News
set A to 101
.getnews
  getframe(A)
  A++
  if (A [ 110) go("getnews")
We only want the headlines frames now. Much of the business and entertainment stuff is boring. I don't care if SARS is causing a problem for the UK Hilton, and quite frankly I'm not that interested if Halle Berry breaks her ulna (ask a medical student if you don't know). Sorry Halle, it's not personal, though I care more about your ulna than I care about Jennifer Garner filing for divorce... namely 'cos I know who Halle Berry is. Who the <beep> is Jennifer Garner? And given the appalling divorce rate, this isn't really newsworthy, is it? Then again, she and her husband, fellow TV actor Scott Foley, had only been married two and a half years (CNN, 16May03). They are splitting, apparently, due to "irreconcilable differences" (yes, that is a Drew Barrymore film - the one where she divorces her parents (only in America!)). Sorry to be a cynic, but I feel that people that only make two and a half years either got married too quickly, or just didn't try hard enough. Mmmm... Maybe this crap isn't so boring after all?
; Business headlines
getframe(701)

; Entertainment headlines
getframe(130)
I like the daily words of wisdom. Some, if I had email, I'd be awfully tempted to send to everybody's favourite president. Like, I dunno, "Whoever fights monsters should see to it that in the process he doesn't become a monster" (Friedrich Nietzsche; CNN 16May03).
; Quote for the day
getframe(178)
Now, the weather. I look for Nantes in the 'weather now' and 'Paris' in the three-day forecast. If you want to know what my weather is right now, look for Nantes on page 463. :-) Sadly our weather is affected by the Atlantic, so the report for 'gai Pari' is about as relevant as the report for London. Still, it's the closest I've got...
; Current weather (Nantes)
getframes(463)

; 3day forecast (Paris)
getframes(470)
That's all the pages fetched and cached. Let's whip up a document...
; now we have all the frames, let's generate ourselves a document
poll_nomessages()
poll_disable()

filewrite("<Teletext$Temp>.Report")
filewriteovnhead()
filewritestring("{align 1}") ; make it all centred
I want little section headings, so I need to output some OvationPro DDL script. If you cannot easily follow the following code, run the script and look at the output.
Don't worry if you cannot access CNN or CNBC. Try simply running the script with, say, BBC tuned in. All the pages will be wrong, but you'll get the gist of it!
; NEWS
filewritestring("{newpara}{textsize 16000}{bold 1}{underline 1}")
filewritebyte(34)
filewritestring("Headlines")
filewritebyte(34)
filewritestring("{bold 0}{underline 0}{textsize 12000}")
filewritebyte(34)
filewritestring(" (from CNN)")
filewritebyte(34)
filewritebyte(10)
filewritestring("{textsize}{bold}{underline}{newpara}")
set A to 101
.writenews
  appendframe(A, 3)
  A++
  if (A [ 110) go("writenews")

; BUSINESS HEADLINES
filewritestring("{newpara}{textsize 16000}{bold 1}{underline 1}")
filewritebyte(34)
filewritestring("Business headlines")
filewritebyte(34)
filewritestring("{bold 0}{underline 0}{textsize 12000}")
filewritebyte(34)
filewritestring(" (from CNN)")
filewritebyte(34)
filewritebyte(10)
filewritestring("{textsize}{bold}{underline}{newpara}")
appendframe(701, 3)

; ENTERTAINMENT HEADLINES
filewritestring("{newpara}{textsize 16000}{bold 1}{underline 1}")
filewritebyte(34)
filewritestring("Entertainment headlines")
filewritebyte(34)
filewritestring("{bold 0}{underline 0}{textsize 12000}")
filewritebyte(34)
filewritestring(" (from CNN)")
filewritebyte(34)
filewritebyte(10)
filewritestring("{textsize}{bold}{underline}{newpara}")
appendframe(130, 3)

; QUOTE
filewritestring("{newpara}{textsize 16000}{bold 1}{underline 1}")
filewritebyte(34)
filewritestring("Quote for the day")
filewritebyte(34)
filewritestring("{bold 0}{underline 0}{textsize 12000}")
filewritebyte(34)
filewritestring(" (from CNN)")
filewritebyte(34)
filewritebyte(10)
filewritestring("{textsize}{bold}{underline}{newpara}")
appendframe(178, 3)

; WEATHER IN NANTES
filewritestring("{newpara}{textsize 16000}{bold 1}{underline 1}")
filewritebyte(34)
filewritestring("The weather in Nantes")
filewritebyte(34)
filewritestring("{bold 0}{underline 0}{textsize 12000}")
filewritebyte(34)
filewritestring(" (from CNN)")
filewritebyte(34)
filewritebyte(10)
filewritestring("{textsize}{bold}{underline}{newpara}")
appendgivenframe(463, 2, 3) ; it is frame 2 of 3 that we want

; JAY LENO
filewritestring("{newpara}{textsize 16000}{bold 1}{underline 1}")
filewritebyte(34)
filewritestring("Jay Leno's guest list")
filewritebyte(34)
filewritestring("{bold 0}{underline 0}{textsize 12000}")
filewritebyte(34)
filewritestring(" (from CNBC)")
filewritebyte(34)
filewritebyte(10)
filewritestring("{textsize}{bold}{underline}{newpara}")
appendgivenframe(182, 2, 3) ; it is frame 2 of 2 that we want

; CONAN
filewritestring("{newpara}{textsize 16000}{bold 1}{underline 1}")
filewritebyte(34)
filewritestring("Conan O'Brien's guest list")
filewritebyte(34)
filewritestring("{bold 0}{underline 0}{textsize 12000}")
filewritebyte(34)
filewritestring(" (from CNBC)")
filewritebyte(34)
filewritebyte(10)
filewritestring("{textsize}{bold}{underline}{newpara}")
appendgivenframe(183, 2, 3); it is frame 2 of 2 that we want
Well, that's the hard work over. All that really remains is to finalise the file, and then run it.
; tidy up
filewriteovntail()
fileclose()
filetype("<Teletext$Temp>.Report", &B25)
oscall("Filer_Run <Teletext$Temp>.Report")
Above, we set the filetype to &B25 - OvPDDL. Then we try to run the file. If OvationPro is loaded, it'll pick up on the file and display it. As OvationPro is booted at startup (on my system), this will auto-load OvationPro, which will then display the document!
And, finally...
; we're done
terminate()
Done!
Return to !Teletext index
Copyright © 2003 Richard Murray