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

system.verbs.apps.Flickr.people.findByUsername

on findByUsername (username) {
	<<Changes
		<<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.
				<<http://www.flickr.com/services/api/flickr.people.findByUsername.html
	flickr.init ();
	local (mystruct);
	new (tabletype, @mystruct);
	mystruct.api_key = user.flickr.prefs.apiKey;
	mystruct.method = "flickr.people.findByUsername";
	mystruct.username = username;
	local (s = [user.flickr.prefs.server].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.