SCREENSHOT AS A SERVICE
HELLO!
I am Cage Chung
I am here because I like to share my experiences.
You can find me at https://kaichu.io / QNAP 雲端應用部資深工程師
https://www.facebook.com/groups/GCPUG.TW/
https://plus.google.com/u/0/communities/116100913832589966421
[您知道”GCPUG”要怎麼唸嗎?為什麼會有一隻狗在 Logo裡面呢?]
Google Cloud Platform User Group的縮寫是GCPUG
GCPUG直接唸成G.C.P.U.G?當然可以!
但它也可以分開來,唸成 G.C. PUG喔~
Pug,指的是巴哥犬,所以 GCPUG的Logo中間才會有一隻可愛的巴哥犬喲。
下次聽到別人說G.C. PUG 的時候,您就可以大聲 說:「我也是G.C. PUG社團成員!」
Outline
◉ Waldo-gcp
◉ How to Screenshot
◉ Screenshot as service via GAE custom runtime
◉ Demo
◉ Study Info
Waldo-gcp
Let’s start with the first set of slides 1
queue
MetadataWaldo Server
App Engine
Task Queues
Cloud Storage
Optimal-way
points
managed VMs
(python27)
...
endpoints API
(OAuth 2)
Object Notification
Cloude
Datastore
snapshot
custom runtim
(nodejs)
Android App
CSV
uploadwaypoints
Store/retrieve
metadata
waypoint map
snapshot
optim
al
road
trip
RESTful APIs for waypoints list, upload
waypoints
[waldo-gcp](https://waldo-gcp.appspot.com/)
Waldo-gcp
[waldo-gcp](https://waldo-gcp.appspot.com/)
Waldo-gcp
How to Screenshot
Let’s start with the second set of slides 2
Phamtonjs
// yahoo.com.tw.js
var page = require('webpage').create();
page.viewportSize = { width: 1440, height: 900 };
page.clipRect = { top: 0, left: 0, width: 1440, height: 900 };
page.open('http://yahoo.com.tw', function() {
page.render('yahoo.com.tw.png');
phantom.exit();
});
// execute
$ phantomjs yahoo.com.tw.js
[Screen Capture | PhantomJS](http://phantomjs.org/screen-capture.html)
Chromeless on AWS Lambda
const chromeless = new Chromeless({ remote: true })
const screenshot = await chromeless
.goto('http://yahoo.com.tw')
.scrollTo(0, 2000)
.screenshot()
console.log(screenshot)
await chromeless.end()
[graphcool/chromeless: Chrome automation made simple. Runs locally or headless on AWS Lambda.](https://github.com/graphcool/chromeless)
puppeteer
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.setViewport({width: 1440, height: 900});
await page.goto('http://yahoo.com.tw',
{ waitUntil: 'networkidle' });
await page.screenshot({
path: 'yahoo.com.tw.png'
});
browser.close();
})();
[GoogleChrome/puppeteer: Headless Chrome Node API](https://github.com/GoogleChrome/puppeteer)
Screenshot as service via GAE custom
runtime
Let’s start with the third set of slides 3
“
GAE screenshot service powered by
Express and PhantomJS.
app.yaml
runtime: custom
env: flex
service: screenshot
resources:
cpu: 1
memory_gb: 1
disk_size_gb: 10
manual_scaling:
instances: 1
handlers:
- url: /.*
script: app.js
Dockerfile
FROM launcher.gcr.io/google/debian8
RUN DEBIAN_FRONTEND=noninteractive apt-get update -y && apt-get install --no-install-recommends -y -q curl apt-utils
build-essential ca-certificates libfreetype6 libfontconfig1
RUN echo "deb http://http.debian.net/debian jessie-backports main" > /etc/apt/sources.list.d/backports.list && 
apt-get update -y && 
apt-get install -y --no-install-recommends fonts-noto fonts-noto-cjk locales-all && 
apt-get clean && 
apt-get autoclean && 
apt-get autoremove && 
rm -rf /var/lib/apt/lists/*
RUN mkdir /nodejs && curl http://nodejs.org/dist/v0.12.1/node-v0.12.1-linux-x64.tar.gz | tar xvzf - -C /nodejs
--strip-components=1
ENV PATH $PATH:/nodejs/bin
WORKDIR /app
ADD package.json /app/
RUN npm install
ADD . /app
ENTRYPOINT ["/nodejs/bin/npm", "start"]
package.json
{
"name": "screenshot-as-a-service",
"description": "Website screenshot service powered by node.js and phantomjs for Waldo-gcp",
"version": "1.1.0",
"repository": "https://github.com/cage1016/screenshot-as-a-service",
"engines": {
"node": ">=0.8.4"
},
"scripts": {
"start": "node app.js"
},
"dependencies": {
"phantomjs": "^1.9.16",
"express": "3.x",
"config": "0.4.15",
"request": "2.9.153"
}
}
dispatch.yaml
dispatch:
- url: "*/favicon.ico"
service: default
- url: "*/_ah/api/*"
service: default
- url: "*/waypoints/*"
service: waypoints
- url: "*/screenshot/*"
service: screenshot
- url: "*/googleae8f4bcce8bec00c.html"
service: ownership
- url: "*/*"
service: frontend
DEMO
Let’s start with the fourth set of slides 4
https://goo.gl/vDHH1o
Waldo-gcp
Trips and Tips
Let’s start with the fifth set of slides 5
“Puppeteer is more easier to build
screenshot as a service than
phantomjs
Study info
◉ GoogleChrome/puppeteer: Headless Chrome Node API -
https://github.com/GoogleChrome/puppeteer
◉ graphcool/chromeless: Chrome automation made simple. Runs
locally or headless on AWS Lambda. -
https://github.com/graphcool/chromeless
◉ cage1016/screenshot-as-a-service: Website screenshot service
powered by node.js and phantomjs -
https://github.com/cage1016/screenshot-as-a-service
◉ Screen Capture | PhantomJS -
http://phantomjs.org/screen-capture.html
THANKS!
Any questions?
You can find me at
https://kaichu.io / cage.chung@gmail.com

More Related Content

PDF
Google apps script introduction
PDF
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開
PDF
Google App Engine (GAE) 演進史
PDF
Gae managed vm introduction
PDF
Continuous Integration & Continuous Delivery with GCP
PDF
Django oscar introduction
PDF
Automating your workflow with Gulp.js
PDF
Frontend JS workflow - Gulp 4 and the like
Google apps script introduction
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開
Google App Engine (GAE) 演進史
Gae managed vm introduction
Continuous Integration & Continuous Delivery with GCP
Django oscar introduction
Automating your workflow with Gulp.js
Frontend JS workflow - Gulp 4 and the like

What's hot (20)

PPTX
Automated Development Workflow with Gulp
PPTX
Introduction to Gulp
PDF
Devenez le plus heureux des Front-end avec Gulp.js
PDF
Intro to Gulp
PDF
Automating Large Applications on Modular and Structured Form with Gulp
PPTX
Gulp: Task Runner
PDF
Google App Engine: Basic
PDF
Gulp - the streaming build system
PDF
Improving your workflow with gulp
PDF
Gulp: Your Build Process Will Thank You
PDF
How to integrate front end tool via gruntjs
PDF
Let's break apache spark workshop
PPTX
JavaScript code academy - introduction
ODP
GulpJs - An Introduction
PDF
Gulp - The Streaming Build System
PDF
Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
PDF
Nas 也可以揀土豆
PDF
Terminus, the Pantheon command-line interface
PDF
Web development tools { starter pack }
PDF
Gdg cloud taipei ddt meetup #53 buildpack
Automated Development Workflow with Gulp
Introduction to Gulp
Devenez le plus heureux des Front-end avec Gulp.js
Intro to Gulp
Automating Large Applications on Modular and Structured Form with Gulp
Gulp: Task Runner
Google App Engine: Basic
Gulp - the streaming build system
Improving your workflow with gulp
Gulp: Your Build Process Will Thank You
How to integrate front end tool via gruntjs
Let's break apache spark workshop
JavaScript code academy - introduction
GulpJs - An Introduction
Gulp - The Streaming Build System
Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
Nas 也可以揀土豆
Terminus, the Pantheon command-line interface
Web development tools { starter pack }
Gdg cloud taipei ddt meetup #53 buildpack
Ad

Viewers also liked (7)

PDF
JSDC 2017 - 使用google cloud 從雲到端,動手刻個IoT
PDF
Waldo-gcp
PDF
Google app engine (gae) 演進史
PDF
痞客趴趴走 Waldo
PDF
Introduction to chrome extension development
PDF
Google apps script introduction
PDF
Google IoT Core 初體驗
JSDC 2017 - 使用google cloud 從雲到端,動手刻個IoT
Waldo-gcp
Google app engine (gae) 演進史
痞客趴趴走 Waldo
Introduction to chrome extension development
Google apps script introduction
Google IoT Core 初體驗
Ad

Similar to Screenshot as a service (6)

PDF
Drone CI/CD 自動化測試及部署
PDF
Instrumentación de entrega continua con Gitlab
PDF
DevOps for Opensource Geospatial Applications
PDF
Google Cloud Platform for Python Developer - Beginner Guide.pdf
PDF
GDG DevFest Kyoto 2014 これからのGoの話をしよう
PPTX
Make stateful apps in Kubernetes a no brainer with Pure Storage and GitOps
Drone CI/CD 自動化測試及部署
Instrumentación de entrega continua con Gitlab
DevOps for Opensource Geospatial Applications
Google Cloud Platform for Python Developer - Beginner Guide.pdf
GDG DevFest Kyoto 2014 これからのGoの話をしよう
Make stateful apps in Kubernetes a no brainer with Pure Storage and GitOps

More from KAI CHU CHUNG (12)

PDF
Devfest 2023 - Service Weaver Introduction - Taipei.pdf
PDF
DevFest 2022 - Skaffold 2 Deep Dive Taipei.pdf
PDF
DevFest 2022 - Cloud Workstation Introduction TaiChung
PDF
Devfest 2021' - Artifact Registry Introduction (Taipei)
PDF
Velero search & practice 20210609
PDF
GDG Cloud Taipei: Meetup #52 - Istio Security: API Authorization
PDF
如何透過 Go-kit 快速搭建微服務架構應用程式實戰
PDF
Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (ht...
PDF
COSCUP 2020 Google 技術 x 公共參與 x 開源 口罩地圖技術開源
PDF
GDG Cloud Taipei meetup #50 - Build go kit microservices at kubernetes with ...
PDF
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
PDF
Global GDG Leaders Summit, Google I/O 2018 經驗分享
Devfest 2023 - Service Weaver Introduction - Taipei.pdf
DevFest 2022 - Skaffold 2 Deep Dive Taipei.pdf
DevFest 2022 - Cloud Workstation Introduction TaiChung
Devfest 2021' - Artifact Registry Introduction (Taipei)
Velero search & practice 20210609
GDG Cloud Taipei: Meetup #52 - Istio Security: API Authorization
如何透過 Go-kit 快速搭建微服務架構應用程式實戰
Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (ht...
COSCUP 2020 Google 技術 x 公共參與 x 開源 口罩地圖技術開源
GDG Cloud Taipei meetup #50 - Build go kit microservices at kubernetes with ...
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
Global GDG Leaders Summit, Google I/O 2018 經驗分享

Recently uploaded (20)

PDF
Internet Download Manager IDM Crack powerful download accelerator New Version...
PDF
Workplace Software and Skills - OpenStax
PPTX
Chapter 1 - Transaction Processing and Mgt.pptx
PDF
Streamlining Project Management in Microsoft Project, Planner, and Teams with...
PPTX
Bandicam Screen Recorder 8.2.1 Build 2529 Crack
PDF
Lumion Pro Crack New latest version Download 2025
PDF
Engineering Document Management System (EDMS)
PDF
What Makes a Great Data Visualization Consulting Service.pdf
PDF
Mobile App Backend Development with WordPress REST API: The Complete eBook
PPTX
string python Python Strings: Literals, Slicing, Methods, Formatting, and Pra...
PDF
infoteam HELLAS company profile 2025 presentation
PDF
MAGIX Sound Forge Pro CrackSerial Key Keygen
PPTX
WJQSJXNAZJVCVSAXJHBZKSJXKJKXJSBHJBJEHHJB
PPTX
Why 2025 Is the Best Year to Hire Software Developers in India
PDF
AI-Powered Fuzz Testing: The Future of QA
PDF
Practical Indispensable Project Management Tips for Delivering Successful Exp...
PPTX
Viber For Windows 25.7.1 Crack + Serial Keygen
PPT
3.Software Design for software engineering
DOCX
Industrial Bio-Lynx: Advanced Biometric Solution for Workforce Management
PDF
CapCut PRO for PC Crack New Download (Fully Activated 2025)
Internet Download Manager IDM Crack powerful download accelerator New Version...
Workplace Software and Skills - OpenStax
Chapter 1 - Transaction Processing and Mgt.pptx
Streamlining Project Management in Microsoft Project, Planner, and Teams with...
Bandicam Screen Recorder 8.2.1 Build 2529 Crack
Lumion Pro Crack New latest version Download 2025
Engineering Document Management System (EDMS)
What Makes a Great Data Visualization Consulting Service.pdf
Mobile App Backend Development with WordPress REST API: The Complete eBook
string python Python Strings: Literals, Slicing, Methods, Formatting, and Pra...
infoteam HELLAS company profile 2025 presentation
MAGIX Sound Forge Pro CrackSerial Key Keygen
WJQSJXNAZJVCVSAXJHBZKSJXKJKXJSBHJBJEHHJB
Why 2025 Is the Best Year to Hire Software Developers in India
AI-Powered Fuzz Testing: The Future of QA
Practical Indispensable Project Management Tips for Delivering Successful Exp...
Viber For Windows 25.7.1 Crack + Serial Keygen
3.Software Design for software engineering
Industrial Bio-Lynx: Advanced Biometric Solution for Workforce Management
CapCut PRO for PC Crack New Download (Fully Activated 2025)

Screenshot as a service