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

newsRiverSuite.pages.postToWeblog

on postToWeblog (adrargs) {
	<<Changes
		<<12/29/05; 7:58:20 PM by DW
			<<Add a "created" attribute to the posts, so permalinks work properly. Tom Morris caught this one. 
	<<scratchpad.ptwargs = adrargs^
	<<edit (@scratchpad.ptwargs)
	
	local (adrdata = newsRiverSuite.init ());
	local (adrstory = @adrdata^.stories.[string.padwithzeros (number (adrargs^.idStory), 8)]);
	local (adrsource = @adrdata^.services.[adrstory^.url]);
	local (viatext = " [<a href=\"" + adrsource^.compilation.channellink + "\">" + adrstory^.channeltitle + "</a>]");
	local (initialtext = adrstory^.storytext + viatext);
	<<wp.newtextobject (initialtext, @scratchpad.initialtext)
	<<edit (@scratchpad.initialtext)
	dotOpmlSuite.blog.openTodaysOutline ();
	op.firstsummit ();
	op.insert (initialtext, up);
	op.attributes.setOne ("created", date.netStandardString (clock.now ())); //12/29/05; 7:58:20 PM by DW
	frontier .bringtofront ();
	if adrdata^.newsRiver.flNewsPageReturnAfterPost {
		if defined (adrargs^.referer) {
			adrargs^.redirect = adrargs^.referer}};
	
	<<if defined (args.idstory)
		<<local (adrstory = radio.aggregator.getStoryAddress (args.idstory))
		<<local (adrsource = @adraggregatordata^.services.[adrstory^.url])
		<<bundle //link the globe to the HTML rendering of the channel
			<<with adrsource^.compilation
				<<msg (adrsource)
				<<globe = "<a href=\"" + channellink + "\" title=\"" + radio.html.translateToEntities (channeldescription) + "\">" + globeimg + "</a>"
		<<add (globe + " <i>Source: " + adrstory^.channeltitle + "; " + adrstory^.time + ".</i><br><br>")
		<<add (adrstory^.storytext + "<br><br>")
		<<add ("<input name=\"sourceName\" type=\"hidden\" value=\"" + adrstory^.channeltitle + "\">")
		<<add ("<input name=\"sourceTime\" type=\"hidden\" value=\"" + adrstory^.time + "\">")
		<<add ("<input name=\"sourceUrl\" type=\"hidden\" value=\"" + adrstory^.url + "\">")
		<<add ("<input name=\"referer\" type=\"hidden\" value=\"" + args.referer + "\">")
		<<add ("<input name=\"idSourceStory\" type=\"hidden\" value=\"" + args.idstory + "\">")
		<<edit (adrstory)
	return ("")};
bundle { //test code
	postToWeblog (@scratchpad.ptwargs)}



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.