Files
m3o-go/examples/thumbnail/screenshot/takeScreenshotOfAUrl/main.go
2021-12-09 15:06:12 +00:00

20 lines
390 B
Go
Executable File

package main
import (
"fmt"
"os"
"go.m3o.com/thumbnail"
)
// Create a thumbnail screenshot by passing in a url, height and width
func main() {
thumbnailService := thumbnail.NewThumbnailService(os.Getenv("M3O_API_TOKEN"))
rsp, err := thumbnailService.Screenshot(&thumbnail.ScreenshotRequest{
Height: 600,
Url: "https://google.com",
Width: 600,
})
fmt.Println(rsp, err)
}