Re: How to recover text from a web page
Thanks for the lead on screen scrapes, but the problem is there is nothing to scrape. The put URL(...) and revBrowserGet(tBrowserId,htmltext) return the html, but not all of the text that is displayed on the page. In fact, if I use Word's merge documents tool to compare the html from pages 2, 9, and 256 of the petition, there is NO DIFFERENCE in the files. The petition signatures and comments are embedded in a petition widget, I think, which I suppose is some javascript applet. Whatever it is, the html definitely does not contain the petition text that I want to evaluate. Nevertheless it is trivial to manually select and copy all of the text on the page. Once it is copied it is easy to automatically paste it, scrape it (that code works fine), and store data using LiveCode, but I do not see a way to select and copy text from this widget using LiveCode. On Tue, 21 Sep 2010 22:23:17, stephen barncard wrote: Why bother with revBrowser at all? Just do this in the message box: put URL(http://website.com/page.html) and this will put the website html into the message box output. Obviously you could do this with fields. Check out Jerry's videos on Screen Scraping: http://revmentor.com/business-logic-screen-scraping-1 http://revmentor.com/business-logic-screen-scraping-0 On 21 September 2010 22:16, Sumner, Walt WSUMNER at dom.wustl.edu wrote: I am trying to recover text from this web page and all of its siblings: http://www.thepetitionsite.com/1/keep-life-saving-electronic-cigarettes-avail able/#sigs/691732733/user/1 The interesting part of the page is the comments, which do not appear in the HTML, but which can be copied manually. I can open this page in a browser in LiveCode. With manual mouse motions, I can double click a block of text, choose Select All from the Edit menu, choose Copy from the Edit menu, and then paste into a field where the comments all appear and are easy to disassemble. Unfortunately, the revbrowser set command and get function do not do anything comparable AFAICT. The Select All choice is not implemented in the DoMenu command. I think that printing a pdf is also out. So, any thoughts on how to automate this part of a petition review? For instance, maybe there is a simple way to save the text to a file with the revBrowserExecuteScript function (using JavaScript for Safari)? BTW, the browser is fully capable of crashing LiveCode on at least some OSX machines. Please don't lose any work for me. Thanks, Walt___ use-revolution mailing list use-revolution at lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution Walton Sumner ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
How to recover text from a web page
I am trying to recover text from this web page and all of its siblings: http://www.thepetitionsite.com/1/keep-life-saving-electronic-cigarettes-available/#sigs/691732733/user/1 The interesting part of the page is the comments, which do not appear in the HTML, but which can be copied manually. I can open this page in a browser in LiveCode. With manual mouse motions, I can double click a block of text, choose Select All from the Edit menu, choose Copy from the Edit menu, and then paste into a field where the comments all appear and are easy to disassemble. Unfortunately, the revbrowser set command and get function do not do anything comparable AFAICT. The Select All choice is not implemented in the DoMenu command. I think that printing a pdf is also out. So, any thoughts on how to automate this part of a petition review? For instance, maybe there is a simple way to save the text to a file with the revBrowserExecuteScript function (using JavaScript for Safari)? BTW, the browser is fully capable of crashing LiveCode on at least some OSX machines. Please don't lose any work for me. Thanks, Walt___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: WWDC Keynote: HTML5 wide open for On-Rev revServer
Sorry if this has been discussed and I missed it, but it looks like Firefox 4 (or 3.7, or earlier) hopes to deliver HTML5 and multitouch, as well as the local data storage. Do we know if On-Rev is on track to host multitouch browser interfaces? If so, I would suddenly have a compelling reason to get facile with On-Rev and HTML5. I would guess that the iOS version of Safari will eventually support multitouch? This video purports to show a Firefox browser window supporting multitouch painting: http://www.labnol.org/internet/firefox-logo-drawn-using-firefox/10579/ Walton Sumner ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Background image problems
Can anyone shed some light on using paint tools and imagedata on images in a bg group? Here's my situation: I have either 1 or 3 pictures to generate, each held by a separate image object. The user adjusts a bunch of settings and then presses a button to generate new pictures. To let the user see what is happening, the first is always visible, and is supposed to update frequently. Because the new picture might look a lot like the old picture, the script selects some gray color and uses the pencil to draw horizontal lines over the first picture. This is fairly quick and gives a clear impression that the picture is being rebuilt. This works fine if the image is not part of a group. It works if the image is not the only image in a group. It seems not to work if the image is the only image in a group (Rev takes enough time to draw gray over the image, but no partially or fully gray image ever appears). Next step is to generate new images. I take the imagedata for the all gray image, which is automatically the right size, make copies as needed for additional images, and then run through the pixels of each imagedata copy, inserting RGB values calculated on the fly. This is 300x faster than using paint tools. After every 1024 pixels, the script sends the imageData on the screen, so it looks like the image is redrawing a line or a few lines at a time. This works fine if the image is not part of a group and the script includes unlock screen commands. It seems not to work if the image is in a group. Finally, the imagedata of the first image is set to the 1st imagedata, the imagedata of the second image is set to the 2nd imagedata, and same for the third. If all three images are in a group with bg behavior, the second and third look right and the first never updates - it's just gray. This problem persists with a 1-card stack. If all three images are not in a group, they all work fine. This application lends itself to making many cards bearing different pictures, so I was hoping to put images in a group with bg behavior. However this seems not to work. I expect that I can remove the images from the group and make new image objects as needed, but what a kluge. Any thoughts on what is going wrong? Rev Ent 3.5.0 dp7 build 820, Intel Macbook Pro OSX, 10.5.5 Thanks, Walt Sumner ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
2.7 bugs in variable watcher, table fields
Anybody else having these problems? 1. Mac OS X: Run a script with a breakpoint. Open the message watcher at the breakpoint. Open the variable watcher after opening the message watcher. Variable watcher echos variable names, refuses to display variable values. Close message watcher. Step forward (which ought to have a keyboard equivalent, by the way). Variable watcher displays variable values. Very confusing until you realize that there is an ugly interaction with the message watcher. 2. Windows XP tablet Save and close all Rev projects that matter to you. Create a label field to sit above a field that will have tab stops. The label field will provide several column headers. Open the property inspector andselect contents Type Column 1 tab Column 2 tab Column 3 (without the quotes and ampersands, just type three column headers) Click the table icon. Nothing is aligned, but I can still work. Deselect the table icon. Now the contents are wrapped, but they are not supposed to be. Select the wrap icon. Nothing happens (already wrapped). Deselect the wrap icon. I can not see, scroll to, or select the text Column 1. Select the wrap icon - there it is again, apparently OK. Go to the property drop list and select Table. Open the task manager since Rev has stopped responding. Check performance. Probably pegged at 100%, of which 96%+/-3% is Rev. Wait 1 minute. Fan kicks in. Let laptop run for 10 minutes while preparing cookie dough. Press right back corner of laptop over raw flattened cookie dough. Cookie will be ready to eat in 5 - 10 minutes. Kill Rev process. Fan will stop in a minute or two. The problems with tables are getting pretty old, folks. As much as I love programming in X-Talk and having instant cross-platform capabilities, it is embarrassing to admit that I have to work around all these bugs, or to lose work, etc, because I don't want to work in a real language. Please fix the bugs. --Walt Sumner ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Inserting XML nodes
Does anyone know of a clean way to insert a child among a list of XML child nodes in a tree, rather than appending the node at the end of the parent node's list of children? I am using an XML structure to store data during and between user sessions, and ultimately to communicate with other programs. There are a lot of optional paths through the tree, but I think their order needs to be maintained. I can make the tree very verbose by enumerating all of the optional paths and leaving them empty, but would rather insert paths as needed. I don't see that the Rev library supports this directly. I have a transcript method to move a child in a list, but it works by deleting children and appending them back as needed - pretty terrible. Example problems: 1. Insert B as Child[2] in this tree structure to create a list in the order A, B, C, without removing the current Child[2] ParentList[1] Child[1] //contains A Child[2] //contains C 2. Insert MiddleInitial[1] = W between FirstName and LastName in this tree structure without removing the LastName[1] child Name[1] FirstName[1] //contains George LastName[1] //contains Bush Any insights would be welcome. Walt Sumner ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: surprising filter benchmarks
The difference is quite a bit smaller if the loop checks the number of items, as the filter is designed to do. Still usually a 3 to 6 fold difference, loop being faster. ... if item 1 of tLine contains a \ AND item 2 of tLine contains r\ AND item 3 of tLine is r \ AND number of items of tLine is 8\ - new then ... Filter: 277 Repeat: 61 --- You wrote --- From: Richard Gaskin [EMAIL PROTECTED] Subject: surprising filter benchmarks To: How to use Revolution use-revolution@lists.runrev.com Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=ISO-8859-1; format=flowed I figured the filter command would carry at least some overhead for its convenience, but I had no idea how much! I wrote the test below to compare it with walking through a list line by line, and the results were surprising: on mouseUp put fwdbCurTableData() into s -- gets 10,800 lines of --tab-delimited data -- -- Method 1: filter command -- put format(*a*\t*r*\tr\t*\t*\t*\t*\t*) into tFilter put s into result1 put the millisecs into t filter result1 with tFilter put the millisecs - t into t1 -- -- -- Method 2: repeat for each -- set the itemdel to tab put the millisecs into t repeat for each line tLine in s if item 1 of tLine contains a \ AND item 2 of tLine contains r\ AND item 3 of tLine is r then put tLinecr after result2 end if end repeat delete last char of result2 put the millisecs - t into t2 -- put result1 into fld result put result2 into fld result2 -- put Filter: t1 cr Repeat: t2 end mouseUp Results - Filter: 745 Repeat: 40 Did I miss something, or am I just seeing the penalty for the filter command's generalization? ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution