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

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


implement tst;

include "sys.m";
	sys: Sys;
include "Flickr.m";
	flickr : Flickr;
	Auth, Photopage : import flickr;

# I had my values hard coded & removed them to upload
secret : con "secret";
apikey : con "api";
token : con "token";


include "draw.m";
	draw : Draw;


tst: module
{
	init: fn(ctxt: ref Draw->Context, args: list of string);
};

init(nil: ref Draw->Context, nil: list of string)
{
	sys = load Sys Sys->PATH;
	draw = load Draw Draw->PATH;
	flickr = load Flickr Flickr->PATH;

	a := ref Auth(secret, apikey, token);
	a.check_token();
#	flickr->get_favourites(a);

	pp := flickr->my_recently_posted_photos(a, 100, 1);
	sys->print("%s", pp.to_string());

#	(categories, groups) := flickr->groups_browse(a, 67);
#	sys->print("%d groups and %d categories\n", len categories, len groups);


#	rat := sys->open("rat.jpg", sys->OREAD);
#	rbytes := array[1360] of byte;
#	sys->read(rat,rbytes, len rbytes);
#	sys->print("%s", flickr->upload_jpeg(a, rbytes));
}

	
#	Put	Limbo	tst >[2] /dev/null > output.dat

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].