Monday, November 08, 2010 at 12:01 AM.


on findByUsername (username) {
		<<8/8/07; 6:14:28 PM by DW
			<<Add call to flickr.init.
		<<8/8/07; 4:31:37 PM by DW
			<<Return the user's id, script error if it fails to find the user.
	flickr.init ();
	local (mystruct);
	new (tabletype, @mystruct);
	mystruct.api_key =;
	mystruct.method = "flickr.people.findByUsername";
	mystruct.username = username;
	local (s = [].flickr.people.findByUsername (mystruct), xstruct);
	s = xml.entityDecode (s, true);
	xml.compile (s, @xstruct);
	<<scratchpad.xstruct = xstruct
	local (adruser = xml.getaddress (@xstruct, "user"));
	return (adruser^.["/atts"].id)};
bundle { //test code
	dialog.alert (findByUsername ("scriptingnews"))}

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.