mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-13 19:45:26 +00:00
20 lines
434 B
Go
Executable File
20 lines
434 B
Go
Executable File
package example
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/micro/services/clients/go/thumbnail"
|
|
)
|
|
|
|
// Create a thumbnail screenshot by passing in a url, height and width
|
|
func TakeScreenshotOfAurl() {
|
|
thumbnailService := thumbnail.NewThumbnailService(os.Getenv("MICRO_API_TOKEN"))
|
|
rsp, err := thumbnailService.Screenshot(&thumbnail.ScreenshotRequest{
|
|
Height: 600,
|
|
Url: "https://m3o.com",
|
|
Width: 600,
|
|
})
|
|
fmt.Println(rsp, err)
|
|
}
|