mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-20 06:25:07 +00:00
Generate clients (#206)
This commit is contained in:
8
examples/thumbnail/screenshot/curl/takeScreenshotOfAUrl.sh
Executable file
8
examples/thumbnail/screenshot/curl/takeScreenshotOfAUrl.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
curl "https://api.m3o.com/v1/thumbnail/Screenshot" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $MICRO_API_TOKEN" \
|
||||
-d '{
|
||||
"height": 600,
|
||||
"url": "https://m3o.com",
|
||||
"width": 600
|
||||
}'
|
||||
18
examples/thumbnail/screenshot/go/takeScreenshotOfAUrl.go
Executable file
18
examples/thumbnail/screenshot/go/takeScreenshotOfAUrl.go
Executable file
@@ -0,0 +1,18 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/micro/services/clients/go/thumbnail"
|
||||
"os"
|
||||
)
|
||||
|
||||
// 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)
|
||||
}
|
||||
16
examples/thumbnail/screenshot/node/takeScreenshotOfAUrl.js
Executable file
16
examples/thumbnail/screenshot/node/takeScreenshotOfAUrl.js
Executable file
@@ -0,0 +1,16 @@
|
||||
import * as thumbnail from "m3o/thumbnail";
|
||||
|
||||
// Create a thumbnail screenshot by passing in a url, height and width
|
||||
async function TakeScreenshotOfAurl() {
|
||||
let thumbnailService = new thumbnail.ThumbnailService(
|
||||
process.env.MICRO_API_TOKEN
|
||||
);
|
||||
let rsp = await thumbnailService.screenshot({
|
||||
height: 600,
|
||||
url: "https://m3o.com",
|
||||
width: 600,
|
||||
});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
await TakeScreenshotOfAurl();
|
||||
Reference in New Issue
Block a user