Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is this dead? #1

Open
austinpray opened this issue Sep 18, 2014 · 13 comments
Open

Is this dead? #1

austinpray opened this issue Sep 18, 2014 · 13 comments

Comments

@austinpray
Copy link
Member

@DarrenCattle

@austinpray
Copy link
Member Author

@DarrenCattle

This is so super ezpz with http://phantomjs.org/

var page = require('webpage').create();
var pagemobile = require('webpage').create();

var date = new Date();
var timestamp = date.getFullYear() + '-' + date.getMonth() + '-' + date.getDate();

page.viewportSize = {
  width: 1300,
  height: 1080
};
pagemobile.viewportSize = {
  width: 320,
  height: 568
};

var pages = [
  'http://mississippihills.dev',
  'http://mississippihills.dev/events/',
  'http://mississippihills.dev/events/month/',
  'http://mississippihills.dev/event/bigtime-event/',
  'http://mississippihills.dev/blog/'
];

var timeout = 2000;

function rShots(index) {
  page.open(pages[index], function() {
    window.setTimeout(function () {
      var filename = 'dist/'+timestamp+'/large/mshills'+index+'.png';
      page.render(filename);
      if(index < pages.length-1) {
        rShots(index+1);
      } else {
        callback();
      }
    }, timeout);
  });
}
function rShotsmobile(index, cb) {
  pagemobile.open(pages[index], function() {
    window.setTimeout(function () {
      var filenameMobile = 'dist/'+timestamp+'/mobile/mshills'+index+'.png';
      pagemobile.render(filenameMobile);
      if(index < pages.length-1) {
        rShotsmobile(index+1);
      } else {
        callback2();
      }
    }, timeout);
  });
}
var callback = function () {
  rShotsmobile(0);
};
var callback2 = function () {
  phantom.exit();
};

rShots(0);

@austinpray
Copy link
Member Author

@ridhoq tell @DarrenCattle to do work pls

@ridhoq
Copy link

ridhoq commented Oct 6, 2014

@DarrenCattle ezpz hacktx idea check it: http://phantomjs.org/screen-capture.html. @austinpray will host the script rite?

@austinpray
Copy link
Member Author

I mean I already wrote the script in a previous comment

@austinpray
Copy link
Member Author

Ye I host

@ridhoq
Copy link

ridhoq commented Oct 6, 2014

There's a bunch of ways to do this. CLI like this https://github.com/superbrothers/capturejs exist too if you wanna get your shell scripting on.

@austinpray
Copy link
Member Author

Ridwan just a banter lad. The screen capture is not a problem, the interesting thing is making a website that features the screenshots in an interesting way.

@DarrenCattle
Copy link
Member

Does this actually work on mshills? I'll implement on progrid at hacktx if you really want. We have lots of possibilities coming up for this event.

@austinpray
Copy link
Member Author

Yes


Sent from my iPhone

On Thu, Oct 16, 2014 at 12:34 PM, Darren Cattle notifications@github.com
wrote:

Does this actually work on mshills? I'll implement on progrid at hacktx if you really want. We have lots of possibilities coming up for this event.

Reply to this email directly or view it on GitHub:
#1 (comment)

@austinpray
Copy link
Member Author

@DarrenCattle ping

@DarrenCattle
Copy link
Member

still has the problem of rendering taking too long. I can check and see if there's an updated phantomjs workaround. Maybe we create a hidden page such as progrid.io/shot that saves a current state of the grid given a hook then I can phantomjs it. I can give a talk about this at another time, I think this is easily possible.

@DarrenCattle
Copy link
Member

Or it just saves the state every minute, then we screenshot it. Definitely possible.

@austinpray
Copy link
Member Author

I could add an endpoint that gives you a json dump of the grid object. Then you can render it out however you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants