I've never used it, but the expect language sounds like the right tool. It's designed specifically for controlling interactive programs and it ships with a script to connect to the Weather Underground telnet service and get a forecast. I would think it could work well with NFBtrans or just about any other interactive program like that. It should be available as an add-on package with just every Linux distribution known, but it requires TCL and TCLX to be installed as I recall.