[00:11] oh yeah...so what you want to do is get a reference to the canvas, which we may already have somewhere, then call canvas.toDataURI('image/png') [00:11] I'm just heading out on vacation but if you send me a link to the current script I can tweak it [00:15] Would I do this with firefox? [00:16] I'm on a headless firefox remember. [00:16] This can certainly wait to after your vacation [00:16] I've got plenty of things to amuse me before then [00:16] Before you get back [00:19] I mean, sounds like I should just use phantomjs [00:49] it should work headless too yeah [01:09] *** godane has left [01:10] Any experience with phantom? [01:11] I have a script now, cobbled from elsewhere, that takes 50 shots of the page. [01:11] I tested with it before the latest 2.x series releases, it was missing some thing we needed [01:11] in theory the current series should work, assuming WebGL isn't needed [01:11] http://teamarchive1.fnf.archive.org/PHANTOM/ [01:11] frames/ is the directory with shots [01:12] Obviously, it's not doing much [01:12] But I do have a pile of frames! [01:12] Vito` with the save [01:12] I want to click the element. I see all sorts of tricks for this [01:13] http://stackoverflow.com/questions/15739263/phantomjs-click-an-element [01:14] the answers further down are the ones you want [01:14] *** godane has joined #jsmess [01:15] 2 [01:15] down vote [01:15] Document.querySelector(element).click()? [01:16] page.evaluate(function() { [01:16] document.getElementById('yourId').click(); [01:16] }); [01:16] says in the 2.x series that should work [01:16] Can you tell me where in archive.js I shove that? [01:17] when are you trying to click on something [01:17] oh I see [01:18] yeah [01:18] I'm going through the HTML to see what it calls the element. [01:19] do that at the top of the first SetTimeout, before // Initial Frame [01:20] document.getElementById("jsmessSS").click() [01:20] that's what you want [01:20] Trying it [01:22] Good news is it worked. Bad news is something fails. [01:22] This is a step forward, tough - no mo guesstimating the location of the button. [01:22] And we can pump something into a funnel [01:23] there's a way to get it to dump the browser console to your terminal [01:24] http://phantomjs.org/api/webpage/handler/on-console-message.html [01:24] stick that before your page.open [01:25] if this isn't an entire remote instance, or if you can open a port, you might also be able to just use Chrome: http://phantomjs.org/release-1.5.html [01:25] "Improved debugging" gives a couple other options [01:26] adding that page.onError bit would probably also help [01:28] http://teamarchive1.fnf.archive.org/PHANTOM/archive.js [01:28] Yeah, that's not outputting anything [01:30] (added some comments to keep track of things.) [01:31] Let's focus on something else for a second... JUST grabbing the canvas element for the screengrab. [01:31] page.render('frames/screenshot'+(frame++)+'.png', { format: "png" }); [01:33] I see our canvas is named canvas [01:36]
[01:36] [01:36] Actually [01:36]
[01:36]
[01:36]
[screenshot]
[01:36]
[01:36] [01:36]
[01:36]
[01:36]
[01:37]
[01:37] So in theory one could have just that I guess [01:38] (I'm playing inside the command line stuff. [01:38] I'm sure browserfs is asking for storage and it's telling it rightly to fuck off [01:39] are you not seeing any errors? [01:39] I am not [01:39] page.onError = function (msg, trace) { [01:39] console.log(msg); [01:39] trace.forEach(function(item) { [01:39] console.log(' ', item.file, ':', item.line); [01:39] }) [01:39] } [01:39] add that before your page.open block [01:43] root@teamarchive1:/0/PHANTOM# phantomjs --local-storage-path=./.localstorage archive.js [01:43] root@teamarchive1:/0/PHANTOM# [01:44] ls [01:44] ls -l [01:44] root@teamarchive1:/0/PHANTOM# du -sh .localstorage/ [01:44] 8.0K .localstorage/ [01:44] Definitely saw it, used it [01:45] I'm trying lots of command-line options. [01:46] http://phantomjs.org/api/command-line.html is where I'm getting them [01:46] My theory is our item downloads are stopped. I realize you'e going in from the other end, to print all errors. [01:46] I mean, you should be seeing what the errors are at this point [01:49] Is the top of it wrong or something? [01:49] http://stackoverflow.com/a/31338510 might be what you want for extracting just the canvas [01:49] replace #hplogo with #canvas [01:49] I thought the placeholder canvas got replaced with something else after it loaded, though [01:50] no your JS looks right [01:54] http://teamarchive1.fnf.archive.org/PHANTOM/frames/screenshot44.png [01:54] THAT is good news [01:54] (Yes, I realize the crapola on the right [01:54] probably only need to do that once [01:54] move the two blocks under // Do just the canvas of the emulator [01:55] to above the // Clicks on the big happy button block [01:56] Done [01:56] Now I'm going to switch URLs [01:56] (Just to see) [01:57] (Still fails) [01:59] Screengrabs temporarily off because I wanted to see what "emulate" had in it. [01:59] Fixed [02:01] Continuing my attack on command line options [02:07] I'm sure it's failing to save something locally [02:08] Just got to figure out what in the settings isn't granting it. [02:09] Problems falling like rain [02:11] 2017-03-04T02:09:51 [DEBUG] WebPage - setupFrame "" [02:11] 2017-03-04T02:09:51 [DEBUG] WebPage - updateLoadingProgress: 10 [02:11] 2017-03-04T02:09:51 [DEBUG] WebPage - setupFrame "" [02:11] 2017-03-04T02:09:51 [DEBUG] WebPage - updateLoadingProgress: 100 [02:11] 2017-03-04T02:09:51 [DEBUG] WebPage - setupFrame "" [02:11] 2017-03-04T02:09:51 [DEBUG] FileSystem - _open: ":/modules/fs.js" QMap(("mode", QVariant(QString, "r"))) [02:11] 2017-03-04T02:09:51 [DEBUG] FileSystem - _open: ":/modules/system.js" QMap(("mode", QVariant(QString, "r"))) [02:11] 2017-03-04T02:09:51 [DEBUG] FileSystem - _open: ":/modules/webpage.js" QMap(("mode", QVariant(QString, "r"))) [02:11] 2017-03-04T02:09:51 [DEBUG] WebPage - updateLoadingProgress: 10 [02:11] 2017-03-04T02:09:51 [DEBUG] WebPage - setupFrame "" [02:12] 2017-03-04T02:09:51 [DEBUG] FileSystem - _open: ":/modules/fs.js" QMap(("mode", QVariant(QString, "r"))) [02:12] 2017-03-04T02:09:51 [DEBUG] FileSystem - _open: ":/modules/system.js" QMap(("mode", QVariant(QString, "r"))) [02:12] 2017-03-04T02:09:51 [DEBUG] FileSystem - _open: ":/modules/webpage.js" QMap(("mode", QVariant(QString, "r"))) [02:12] 2017-03-04T02:09:51 [DEBUG] WebPage - updateLoadingProgress: 100 [02:12] 2017-03-04T02:09:51 [DEBUG] CookieJar - Purged (session) "PHPSESSID=0k21i93cseu81p0qqaap2k1a26; domain=.archive.org; path=/" [02:12] -- [02:12] Not a lot of anything helpful, although it's "working" even if it fails [02:18] pinged db48x [02:18] SyntaxError: Expected token '}' ia802608.us.archive.org/8/items/jsmess_keyboard_v2/arcade-williams.js:11 [02:18] got the remote debugger working [02:19] sometimes these things can be flaky about the JS they'll accept, was just using one that crapped out on heavily minified JS [02:19] was fine on the unminified stuff [02:21] https://github.com/ariya/phantomjs/issues/12867 was an example of that [02:22] I'm switching to an Apple II program [02:23] I'm using timestamps against the thing to know we're not doing poorly here. [02:23] I'm this close to adding a command line call for it and cleaning up frames after each hit. [02:24] if it's barfing on our JS though it's never gonna run the apps [02:24] that said, isn't this on a machine with xvfb already? [02:25] Agreed which is why I swapped away rom using jsmesskeyboard_v2 [02:25] The others don't. [02:25] So if you run it now, it won't hit the minified [02:29] huhn [02:29] still failed on that URL [02:30] but no errors that would suggest why [02:30] * Vito` shrugs [02:30] phantomjs is not super reliable [02:31] if you have xvfb already, you might instead consider [02:31] http://www.nightmarejs.org [02:32] or https://slimerjs.org which is Gecko-based [02:33] in my experience trying to use Phantom for other things, if you can't get it working pretty quick, you probably won't, it's pretty flaky and unreliable [02:50] My response would be along the lines of how much you're up for helping. [02:50] I'm out of my depth, although as we can see the actual task is pretty simple [02:53] sorry, I'm not prepared to work on this at all [02:53] I'm just saying since it's not working out of the box, all effort may be wasted, because phantomjs is not super reliable [02:54] Well, in this case, it's consistently unreliable. :) [02:55] I pinged db to see if he has insight [02:56] slimer's not going to be better than HEADSHOT (my bash script) [03:01] Installing Node [03:03] "npm install nightmare" says it all [03:13] Installed. Invoking it.... issues [03:18] If when bai becomes available he might have ideas where the loader's breaking down. [03:18] This feels a LOT like it's the.... hey hmmm [03:25] Yeah, will need help [03:25] Slime's a mess though. [03:28] Thanks again, Vito` [03:35] *** Ravenloft has quit IRC (Read error: Connection reset by peer) [04:01] *** db48x has joined #jsmess [05:27] *** db48x` has joined #jsmess [05:29] *** db48x has quit IRC (Read error: Operation timed out) [05:31] db48x`: Hi [06:12] *** X-Scale has quit IRC (Quit: Try HydraIRC -> http://www.hydrairc.com <-) [09:53] SketchCow: howdy [09:53] *** db48x` is now known as db48x [10:25] *** wdna has joined #jsmess [11:02] We had an adventure today! [11:02] Vito` helped with making screenshots work after a fashion [11:02] Like, I can run phantomjs and it snaps stuff. [11:03] http://teamarchive1.fnf.archive.org/PHANTOM/ [11:03] As you can see in the frames/ directory, we actually screenshot! [11:04] But the loading fails. [11:04] I suspect it's something stupid. [11:08] http://teamarchive1.fnf.archive.org/PHANTOM/archive.js is the phantomjs script [11:08] Culled from the corpses of a thousand bastard scripts and Vito`'s skills [11:15] Gotta take a quick exercise walk - let me knowif you have ideas/questions [12:46] *** wdna has quit IRC (Quit: WeeChat 1.7) [12:48] *** wdna has joined #jsmess [15:47] *** wdna has quit IRC (Quit: WeeChat 1.7) [15:53] :) [15:54] any output in the console? [16:00] your script looks workable [19:20] No output on the script. I think I can port it to a port though [19:29] pacman.js was me using tilde.club/~pacman to just force stuff without all that k-razy IA stuff [19:29] To see if it's a CORS thing [19:30] Let me try metacade [19:30] db48x: I wasn't getting any errors, which makes me think it's a weird phantomjs compatibility problem [19:32] http://teamarchive1.fnf.archive.org/PHANTOM/frames/screenshot1.png [19:32] So that's with zero IA schmutz [19:35] That's using http://assets.metacade.com/emulators/pacman.html [20:06] a lot of different exceptions could cause that [20:07] you're catching exceptions and printing them with console.log [20:07] what's in that console output? [20:07] nothing [20:08] I ran it locally and got nothing in the console [20:08] or in the remote debugger [20:08] print something unconditionally and make sure that much is working? [20:08] it prints other stuff, and I see like CSS errors and stuff in the remote debugger console [20:09] but no JS errors or failures [20:09] hmm [20:09] ok, in the remote debugger, make sure you're debugging the webpage and tell it to stop on all exceptions, even ones that are caught [20:10] I can upload the script I was using if you want to try that [20:11] I saw it, but I don't have phantomjs all set up [20:11] if that fails, you could just single-step through the loader.js code [20:11] starting around line 955 [20:12] time for me to sleep though [21:23] *** X-Scale has joined #jsmess [23:07] Yeah, sorry my time is so shifted here