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

myTwitterProfileSuite.saveStaticFile

on saveStaticFile (username, filetext, pagenum=nil) {
	<<Changes
		<<5/20/09; 10:53:38 AM by DW
			<<Created. 
	local (adrdata = myTwitterProfileSuite.init (), adrcache);
	bundle { //set adrcache
		local (idpage);
		adrcache = @adrdata^.cache.[username];
		if not defined (adrcache^) {
			new (tabletype, adrcache)};
		if pagenum == nil {
			idpage = "index"}
		else {
			idpage = string.padwithzeros (pagenum, 5)};
		adrcache = @adrcache^.[idpage]};
	if defined (adrcache^) {
		if adrcache^.filetext == filetext {
			adrcache^.ctreads++;
			adrcache^.whenLastRead = clock.now ();
			return (adrcache^.url)}};
	local (server = "xmlrpc://rpc.mytwitterprofile.com:5337/RPC2", url);
	if pagenum == nil {
		url = [server].mytwitterProfile.saveWebText (username, filetext)}
	else {
		url = [server].mytwitterProfile.saveWebText (username, filetext, pagenum)};
	bundle { //create the cache table
		new (tabletype, adrcache);
		adrcache^.filetext = filetext;
		adrcache^.url = url;
		adrcache^.ctreads = 0;
		adrcache^.whenLastRead = date (0)};
	return (url)};
bundle { //test code
	saveStaticFile ("davewiner", "oh the buzzing")}



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.