Skip to content

Commit c1e170a

Browse files
committed
Update README.md to include examples for fetch methods
1 parent ea9b5e1 commit c1e170a

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ const url = capture.buildImageUrl('https://capture.techulus.in/', {
2626
delay: 3,
2727
t: Date.now()
2828
});
29+
30+
// or
31+
32+
const image = await capture.fetchImage('https://capture.techulus.in/', {
33+
full: true,
34+
delay: 3,
35+
t: Date.now()
36+
});
2937
```
3038
Now stick that url in an img tag to render the screenshot!
3139

@@ -42,6 +50,14 @@ const url = capture.buildPdfUrl('https://capture.techulus.in/', {
4250
delay: 3,
4351
t: Date.now()
4452
});
53+
54+
// or
55+
56+
const pdf = capture.fetchPdf('https://capture.techulus.in/', {
57+
full: true,
58+
delay: 3,
59+
t: Date.now()
60+
});
4561
```
4662

4763
### Content
@@ -53,6 +69,10 @@ const capture = new Capture(YOUR_API_KEY, YOUR_API_SECRET);
5369
// var url = capture.buildContentUrl(URL_TO_CAPTURE, CAPTURE_OPTIONS);
5470

5571
const url = capture.buildContentUrl('https://capture.techulus.in/');
72+
73+
// or
74+
75+
const content = await capture.fetchContent('https://capture.techulus.in/');
5676
```
5777

5878
### Metadata
@@ -64,4 +84,8 @@ const capture = new Capture(YOUR_API_KEY, YOUR_API_SECRET);
6484
// var url = capture.buildMetadataUrl(URL_TO_CAPTURE, CAPTURE_OPTIONS);
6585

6686
const url = capture.buildMetadataUrl('https://capture.techulus.in/');
87+
88+
// or
89+
90+
const content = await capture.fetchMetadata('https://capture.techulus.in/');
6791
```

0 commit comments

Comments
 (0)