mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-12 10:55:11 +00:00
37 lines
723 B
Markdown
Executable File
37 lines
723 B
Markdown
Executable File
# Thumbnail
|
|
|
|
An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/thumbnail/api](https://m3o.com/thumbnail/api).
|
|
|
|
Endpoints:
|
|
|
|
## Screenshot
|
|
|
|
Create a thumbnail screenshot by passing in a url, height and width
|
|
|
|
|
|
[https://m3o.com/thumbnail/api#Screenshot](https://m3o.com/thumbnail/api#Screenshot)
|
|
|
|
```go
|
|
package example
|
|
|
|
import(
|
|
"fmt"
|
|
"os"
|
|
|
|
"go.m3o.com/thumbnail"
|
|
)
|
|
|
|
// Create a thumbnail screenshot by passing in a url, height and width
|
|
func TakeScreenshotOfAurl() {
|
|
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)
|
|
|
|
}
|
|
```
|