Monday, November 08, 2010 at 12:00 AM.
river2Suite.ftpNews
on ftpNews (htmltext, adrimages) { <<Changes <<6/20/09; 12:44:36 PM by DW <<Created. Kind of a klooge, but this is just for testing and publicity. I don't think users are going to use this. Note: You only have to enable it when one of the images changes, otherwise you can leave it disabled. local (adrdata = river2suite.init ()); if adrdata^.prefs.ftp.enabled { local (server = adrdata^.prefs.ftp.server); local (username = adrdata^.prefs.ftp.username); local (password = adrdata^.prefs.ftp.password); local (path = adrdata^.prefs.ftp.path, imagespath, adr); local (connection = tcp.ftp.openConnection (server, username, password)); tcp.ftp.writefile (connection, htmltext, path); bundle { //set imagespath local (i); imagespath = path; for i = sizeof (imagespath) downto 1 { if imagespath [i] == "/" { imagespath = string.mid (imagespath, 1, i) + "images/"; break}}}; for adr in adrimages { local (fpath = imagespath + nameof (adr^)); tcp.ftp.writefile (connection, string (adr^^), fpath)}; tcp.ftp.closeConnection (connection)}}; bundle { //test code window.about (); ftpNews (string (scratchpad.htmltext), @scratchpad.viewNewsParams.river2images)}
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.