Wednesday, December 22, 2010 at 12:00 AM.


on getAllPhotos (groupId, adrtable) {
		<<8/11/10; 8:01:30 PM by DW
			<<If there's an error processing a page, keep going.
		<<8/10/10; 10:04:53 PM by DW
			<<Created. Returns a table with info about all the photos in a pool. Using the id you can download the pictures to a folder, or whatever.
			<<It may not immediately be obvious what the id of the group is. If you get the group displayed in your web browser, then locate the RSS feed, you'll see the id in the URL for the feed.
				<<For example here's the URL for the feed of the landing around the world pool.
				<<The id should be pretty obvious! :-)
	local (pagenum = 1, ctpages);
	new (tabletype, adrtable);
	loop {
		local (mystruct);
		new (tabletype, @mystruct);
		mystruct.api_key =;
		mystruct.auth_token =;
		mystruct.group_id = groupId; = pagenum;
		Flickr.signStruct (@mystruct);
		local (s = [].flickr.groups.pools.getPhotos (mystruct), xstruct);
		try {
			s = xml.entitydecode (s, true);
			xml.compile (s, @xstruct);
			<<scratchpad.xstruct = xstruct
			local (adrphotos = xml.getaddress (@xstruct, "photos"), i);
			ctpages = adrphotos^.["/atts"].pages;
			for i = 1 to sizeof (adrphotos^) {
				local (adrphoto = @adrphotos ^ [i]);
				if nameof (adrphoto^) endswith "photo" {
					local (adrsub = @adrtable^.[string.padwithzeros (sizeof (adrtable^) + 1, 5)]);
					adrsub^ = adrphoto^.["/atts"]}}};
		if pagenum == ctpages {
bundle { //test code
	<<getAllPhotos ("726229@N24", //landing around the world pool
	<<getAllPhotos ("1447436@N22", //HTC Incredible pool
	getAllPhotos ("1121198@N20",} //Let's Put Gruber to Work

This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.