Monday, November 08, 2010 at 12:07 AM.


on getRecentItemsForSub (url, numberOfItems, username, password) {
		<<11/6/02; 1:42:04 PM by JES
			<<Created. Get the most recent items in a given subscription as an array of structs. The structs match the struct returned by aggregator.getItem.
	xml.aggregator.securityForRpc (client, username, password);
	local (adrdata = xml.aggregator.init ());
	local (adrstories = @adrdata^.stories);
	local (sizestories = sizeOf (adrstories^));
	local (returnStruct); new (tableType, @returnStruct);
	local (i, ct = 0);
	for i = sizestories downto 1 {
		local (adritem = @adrstories^[i] );
		if adritem^.url == url {
			local (itemId = nameOf (adritem^));
			returnStruct.[itemId] = xml.aggregator.rpcHandlers.getItem (itemId, username, password)};
		if ct == numberOfItems {
	return (returnStruct)}
<<bundle //testing
	<<local (t); new (tabletype, @t)
	<<t.client = ""
		<<scratchpad.items = callscript (@xml.aggregator.rpcHandlers.getRecentItemsForSub, {"", 10, remoteUsername, remotePassword}, @t)

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.