GoogleChromeLabs/psi

Google APIs screenshot

Closed this issue · 15 comments

Hi,
Google APIs is supporting retrieving a screenshot from the result.
Is this supported on your plugin?
screen shot 2017-08-28 at 2 36 47 pm

Obviously so far not, so this would need to be implemented.

In v5+ the API returns final_screenshot and filmstrips as data uris. Not sure how we'd expose them on cli, maybe saving them as images and then linking to them with a flag.

If that's interesting post it here as a possible enhancement.

Hi @exterkamp maybe it's not necessary to expose on cli but we could save them, as you say.

I think filmstrips could be useful for users than want to make performance regression tests. What do you think?

Best regards.

if anyone is making regression tests then they should just work with the JSON data directly. i dont think this utility saving the datauris to disk would be too helpful.

if anyone is making regression tests then they should just work with the JSON data directly. i dont think this utility saving the datauris to disk would be too helpful.

You are right, this utility should only provide the data. Users should be on charge of saving (or not) the data if they need to.

Exactly. So is there still something needed / missing that users can get / consume this data?

Exactly. So is there still something needed / missing that users can get / consume this data?

As @exterkamp said filmstrips are returned by v5 but psi tool is not exposing that data but user could get it using the psi output:

const psi = require('psi');

(async () => {
  // Get the PageSpeed Insights report
  const {data} = await psi('https://theverge.com');
  console.log(data.lighthouseResult.audits['screenshot-thumbnails'].details.items);
})();

+1 to @paulirish & @JuanMaRuiz, this data is accessible to the user already.

I think this could be part of a cookbook on how to do common things, like getting screenshots out of a result e.g. the code that @JuanMaRuiz made. Maybe a doc opportunity?

@exterkamp I think it would be a good idea to document it. Where should be the cookbook/doc placed? Maybe as a wiki page within this repo? Maybe gulp/grunt/ ... examples could be added there as well. What do you think? Make it sense for you?

Didn't see that there was a question directed at me here, whoops!

Could add it to the main readme in a cookbook section? Maybe put it in a <details> element similar to these? Maybe "Getting PSI into your build process" also belongs in a details element in a "Common Use cases" section.

Didn't see that there was a question directed at me here, whoops!

Could add it to the main readme in a cookbook section? Maybe put it in a <details> element similar to these? Maybe "Getting PSI into your build process" also belongs in a details element in a "Common Use cases" section.

SGTM the idea of a Recipes section. I can try and make a PR with the proposal. Does that sound good to you @exterkamp ?

Best regards.

Sounds like a plan!

Hi @exterkamp PR was merged. I think this issue cloud be closed, isn't it?

Yup!