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
|