sshot is a tool to take the screenshot of a website.
Just curl to the endpoint with url
parameter.
$ curl "https://vckvs9l162.execute-api.ap-northeast-1.amazonaws.com/production/screenshot?url=https://github.com/asmsuechan"
{"screenshot":{"url":"https://s3-ap-northeast-1.amazonaws.com/sshot-images/kvd6ajor2hbprpb9.png"}}
Caution: Your screenshots will be uploaded to our public S3 bucket (sshot-images). If you hate to make your screenshots public, you should deploy your own sshot on your AWS by serverless framework.
Available options in query parameter are:
name | value |
---|---|
url | string (e.g. https://github.com) |
base64 | boolean (true/false) |
- Clone this repository and run
yarn
- Install
serverless
framework - Create an IAM user with appropreate rights for
serverless
and get its credentials - Create a S3 bucket
- Fill config.json
- Set environment variables (
AWS_ACCESS_KEY_ID
,AWS_SECRET_ACCESS_KEY
,REGION
) to run serverless - Run
yarn run deploy
Actual steps are:
$ git clone https://github.com/asmsuechan/sshot.git
$ cd sshot
$ yarn
$ yarn add global serverless
$ vim config.json
$ cat config.json
{
"AWS_ACCESS_KEY_ID": "your key",
"AWS_SECRET_ACCESS_KEY": "your key",
"REGION": "your region",
"BUCKET_NAME": "your bucket name"
}
$ export AWS_ACCESS_KEY_ID=xxxxxxxx
$ export AWS_SECRET_ACCESS_KEY=xxxxxxxxx
$ export REGION=ap-northeast-1
$ yarn run deploy
Any questions? Open an issue and ask us, please.
TODO