«Changes «9/3/03; 6:26:36 PM by DW «Hacked together a script to search the aggregator archive. «It could be much more efficient and it could have a nice user interface. «But it worked, it found the link I was looking for. ;-> «Here's the post it made possible. «http://scriptingnews.userland.com/2003/09/03#When:12:57:03PM «I had the link to the story in the Times archive, but it was to the abstract, not the full story. «The quote I was looking for wasn't in the abstract. I knew that if I had the URL from the story with the partner=USERLAND bit, it would let me read the whole story. «But it had long since scrolled off my News page in Radio. That's where this script came in. «It reads the XML archives stored locally, looking for a story containing the "lookfor" string. «It found it very quickly. I was happy. «Now if I was going to do a lot of this I would cache the tables in the object database, and then if I needed it to be even faster, I'd hook it into the built-in search engine. (A little known feature of the kernel.) local (lookfor = "In a Long Presidential Race, Dean Sprints"); local (nomad = clock.now (), pc = file.getpathchar ()); local (basefolder = frontier.pathstring + "backups" + pc + "aggregatorArchive" + pc); loop { local (day, month, year, hour, minute, second); date.get (nomad, @day, @month, @year, @hour, @minute, @second); on pad (x) { return (string.padwithzeros (x, 2))}; local (f = basefolder + year + pc + pad (month) + pc + pad (day) + pc + pad (hour) + ".xml"); msg (f); try { local (xmltext = string (file.readWholeFile (f)), news); table.xmlToTable (xmltext, @news); local (adr); for adr in @news { if adr^.storytext contains lookfor { scratchpad.news = news; edit (@scratchpad.news); return}}}; if hour == 0 { hour = 23; day--} else { hour--}; nomad = date.set (day, month, year, hour, minute, second)}