Tuesday, March 29, 2011 at 1:07 AM.

river2Suite.static.buildJsonNews

on buildJsonNews (adruser) {
	<<Changes
		<<3/28/11; 7:47:25 AM by DW
			<<Code cleanup.
		<<2/13/11; 8:53:06 AM by DW
			<<Each river3.js file has a unique name.
		<<2/7/11; 8:47:11 PM by DW
			<<Write out river3.js -- it's in version 3 format, the one that's compatible with the new beautiful rivers.
				<<http://groups.google.com/group/river-of-news/browse_thread/thread/64ec387b5210ff5b
		<<2/5/11; 12:48:58 PM by DW
			<<Write out river.js.
		<<1/7/11; 5:06:12 PM by DW
			<<tmp.json becomes index.json.
		<<12/30/10; 5:27:22 PM by DW
			<<Write out a tmp.json file containing the version 3 stuff. Once it's passed validation, it'll replace the previous version 1 stuff.
		<<12/19/10; 4:17:24 AM by DW
			<<Ooops, they don't like the new version on the list. Switched back to version 1.
		<<12/18/10; 7:18:42 PM by DW
			<<Build version 2 format files.
		<<12/5/10; 4:21:38 PM by DW
			<<Created. 
	local (adrdata = river2suite.init (), nameuser = nameof (adruser^), pagetable, startticks = clock.ticks ());
	
	river2Suite.static.setupPagetable (adruser, @pagetable, ".json");
	html.setpagetableaddress (@pagetable);
	
	local (jsontext = river2Suite.viewJsonNews3 ()); //1/7/11 by DW
	river2Suite.static.writeFile (pagetable.river2.staticFname, jsontext, adruser);
	
	bundle { //write out river3.js, 2/13/11 by DW
		local (s = "onGetRiverStream (" + jsontext + ")", fname);
		if adruser == nil {
			fname = "river3.js"}
		else {
			fname = nameof (adruser^) + "River3.js"};
		river2Suite.static.writeFile (fname, s, adruser)};
	
	bundle { //log the stats, 12/5/10 by DW
		if adruser != nil {
			river2Suite.initUser (adruser);
			adruser^.stats.ctJsonBuilds++;
			adruser^.stats.whenLastJsonBuild = clock.now ();
			adruser^.stats.ctTicksLastJsonBuild = clock.ticks () - startticks}}};
bundle { //test code
	buildJsonNews (@config.river2.users.wikiriver)}



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.