implement BBC; include "sys.m"; sys: Sys; include "draw.m"; Context: import Draw; include "arg.m"; arg : Arg; include "sslsession.m"; include "keyring.m"; include "asn1.m"; include "pkcs.m"; include "x509.m"; include "ssl3.m"; ssl3: SSL3; include "httpc.m"; httpc :Httpc; Connection : import httpc; include "RSS.m"; rss : RSS; Feed : import rss; BBC : module { init: fn(nil: ref Context, args : list of string); }; init(nil: ref Context, args: list of string) { sys = load Sys Sys->PATH; arg = load Arg Arg->PATH; arg->init(args); arg->setusage("BBC -f uri"); rss = load RSS RSS->PATH; rss->init(); uri := "/rss/newsonline_uk_edition/front_page/rss.xml"; while((c := arg->opt()) != 0) case c { 'f' => uri = arg->earg(); } if(uri == "") arg->usage(); feed := rss->feed("tcp!newsrss.bbc.co.uk!80", "newsrss.bbc.co.uk", uri, 0); feed.fetch(); } # ./BBC -f /rss/newsonline_uk_edition/front_page/rss.xml