Plan 9 from Bell Labs’s /usr/web/sources/contrib/maht/inferno/appl/cmd/BBC.b

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


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


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].