#define BASE "/users/cardeci/export/" mapping replaces= ([]); string fortune() { return "
\n"+popen("/usr/local/bin/fortune -l")+"
\n\n"; } string engdikt() { string *dir; dir=get_dir("/users/cardeci/export/enpoems/*"); return ("
\n"+
	  read_bytes("/users/cardeci/export/enpoems/" + 
		     dir[random(sizeof(dir))]) +
	  "
\n\n"); } string svdikt() { string *dir; dir=get_dir("/users/cardeci/Text/dikter/klara/*"); return ("
\n"+
	  read_bytes("/users/cardeci/Text/dikter/klara/" + 
		     dir[random(sizeof(dir))]) +
	  "
\n\n"); } void create() { mixed b; foreach( read_bytes( "/users/cardeci/export/default_replaces" ) / "\n" , b ) if( sizeof( b /= "=" ) > 1) replaces[ b[0] ] = ""+b[0]+""; replaces["\n\n"]="\n\n

\n\n"; replaces[""]=engdikt(); replaces[""]=svdikt(); replaces[""]=fortune(); replaces[""]="


"; call_out( create, 24 * 3600 ); // 24 hrs. } string preparse( string s, mapping how, string base ) { string a, b, t; a = b = ""; if( how[ "lang" ] == "eng" ) while(sscanf(s, "%*s%s%s", b, s)) a += b; else while(sscanf(s, "%*s%s%s", b, s)) a += b; if( strlen(a) ) s = a; s = replace(s, m_indices(replaces), m_values(replaces)); if(sscanf(s, "%*s%s%s", a, s)) s = "" + (t=a) + "

" + a + "

\n\n" + s; while(sscanf(s, "%s%s%s", a, b, s) == 3) s = a + "" + b +"" + s; while(sscanf(s, "%s%s", a, b, s) == 3) s = a + "" + s; while(sscanf(s, "%s%s%s", a, b, s) == 3) s = a + "

" + b[0..0] +"" + b[1..10000] + "

" + s; #if 0 while(sscanf(s, "%s%s%s", a, b, s) == 3) s = a + "

" + b[0..0] +"" + b[1..10000] + "

" + s; #else s=replace(s, ({ "", "" }), ({ "

", "

" })); #endif if(how["verbosity"] == "onl") { t += " (compressed menu form)"; b = ""+ t + "" + "

" + t + "

\n\n