Tuesday, August 18, 2009 at 7:30 PM.

myTwitterProfileSuite.saveButton

on saveButton () {
	<<Changes
		<<3/21/09; 10:29:02 PM by DW
			<<Created. Called when the user clicks on the Save button in the window.
	local (adrdata = myTwitterProfileSuite.init (), xstruct);
	local (username = adrdata^.prefs.username, password = adrdata^.prefs.password);
	xml.compile (op.outlinetoxml (@adrdata^.outline), @xstruct);
	scratchpad.opmlstruct = xstruct;
	local (adropml = xml.getaddress (@xstruct, "opml"));
	local (adrbody = xml.getaddress (adropml, "body"), adroutline);
	local (name = nil, location = nil, url = nil, bio = nil);
	for adroutline in adrbody {
		on getsubval () {
			local (adrsub = xml.getaddress (adroutline, "outline"));
			return (adrsub^.["/atts"].text)};
		if nameof (adroutline^) endswith "outline" {
			case string.lower (adroutline^.["/atts"].text) {
				"name" {
					name = getsubval ()};
				"location" {
					location = getsubval ()};
				"bio" {
					bio = getsubval ()};
				"web" {
					url = myTwitterProfileSuite.saveOutline ("Home", username, adroutline)}}}};
	<<twitter.updateUserProfile (username, password, name:name, url:url, location:location, description:bio)
	thread.callscript (@myTwitterProfileSuite.saveTwitterProfile, {username, password, name, url, location, bio});
	speaker.beep ()};
bundle { //test code
	saveButton ()}



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.