Skip to content

Commit

Permalink
chore(repo): replace mp4 with full page scrolling mp4 example, update…
Browse files Browse the repository at this point in the history
… readme to refer to assets dir
  • Loading branch information
AJCJ1 committed Dec 24, 2024
1 parent 0d55c0e commit a05536e
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 44 deletions.
Binary file modified Assets/mp4.mp4
Binary file not shown.
76 changes: 38 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Check out our [blog](https://urlbox.com/blog) for more insights on everything sc


# Table Of Contents

<!-- TOC -->
* [Documentation](#documentation)
* [Requirements](#requirements)
Expand All @@ -37,19 +37,19 @@ Check out our [blog](https://urlbox.com/blog) for more insights on everything sc
* [Handling Errors](#handling-errors)
* [Dependency Injection](#dependency-injection)
* [Utility Functions](#utility-functions)
* [`TakeScreenshot(options)`](#takescreenshotoptions)
* [`TakePdf(options)`](#takepdfoptions)
* [`TakeMp4(options)`](#takemp4options)
* [`TakeScreenshotWithMetadata(options)`](#takescreenshotwithmetadataoptions)
* [`ExtractMetadata(options)`](#extractmetadataoptions)
* [`ExtractMarkdown(options)`](#extractmarkdownoptions)
* [`ExtractHtml(options)`](#extracthtmloptions)
* [`ExtractMhtml(options)`](#extractmhtmloptions)
* [`DownloadAsBase64(options)`](#downloadasbase64options-)
* [`DownloadToFile(options, filePath)`](#downloadtofileoptions-filepath-)
* [`GeneratePNGUrl(options)`](#generatepngurloptions-)
* [`GenerateJPEGUrl(options)`](#generatejpegurloptions-)
* [`GeneratePDFUrl(options)`](#generatepdfurloptions-)
* [`TakeScreenshot(options)`](#takescreenshotoptions)
* [`TakePdf(options)`](#takepdfoptions)
* [`TakeMp4(options)`](#takemp4options)
* [`TakeScreenshotWithMetadata(options)`](#takescreenshotwithmetadataoptions)
* [`ExtractMetadata(options)`](#extractmetadataoptions)
* [`ExtractMarkdown(options)`](#extractmarkdownoptions)
* [`ExtractHtml(options)`](#extracthtmloptions)
* [`ExtractMhtml(options)`](#extractmhtmloptions)
* [`DownloadAsBase64(options)`](#downloadasbase64options-)
* [`DownloadToFile(options, filePath)`](#downloadtofileoptions-filepath-)
* [`GeneratePNGUrl(options)`](#generatepngurloptions-)
* [`GenerateJPEGUrl(options)`](#generatejpegurloptions-)
* [`GeneratePDFUrl(options)`](#generatepdfurloptions-)
* [Popular Use Cases](#popular-use-cases)
* [Taking a Full Page Screenshot](#taking-a-full-page-screenshot)
* [Example MP4 (Full Page)](#example-mp4--full-page-)
Expand Down Expand Up @@ -156,19 +156,19 @@ namespace MyNamespace

If you use the above with your own keys, it will give you back an object with a `renderUrl`. Making a GET request to that renderUrl will give you back a PNG back like this:

![](../Images/urlbox-png.png)
![](Images/urlbox-png.png)

***

## Configuring Options
## Configuring Options

Passing options are where the magic comes in. Options are simply extra inputs that we use to adapt the way we take the screenshot, or adapt any of the other steps involved in the rendering process.

>**Note:** Almost all of our options are optional. However, you must at least provide a URL or some HTML in your options in order for us to know what we are rendering for you.
You could, for example, change the way the request is made to your desired URL (like using a proxy server, passing in extra headers, an authorization token or some cookies), or change the way the page looks (like injecting Javascript, highlighting words, or making the background a tasteful fuchsia pink).
You could, for example, change the way the request is made to your desired URL (like using a proxy server, passing in extra headers, an authorization token or some cookies), or change the way the page looks (like injecting Javascript, highlighting words, or making the background a tasteful fuchsia pink).

There are a few ways to retrieve a screenshot from Urlbox, depending on how and when you need it. You could retrieve it as a [raw file](https://urlbox.com/docs/options#response_type) (using `UrlboxOptions.ResponseType(ResponseType.Binary)` ), or by default, as a JSON object with its size and stored location.
There are a few ways to retrieve a screenshot from Urlbox, depending on how and when you need it. You could retrieve it as a [raw file](https://urlbox.com/docs/options#response_type) (using `UrlboxOptions.ResponseType(ResponseType.Binary)` ), or by default, as a JSON object with its size and stored location.

There are a plethora of other options you can use. Checkout the [docs](https://urlbox.com/docs/overview) for more information.

Expand Down Expand Up @@ -461,19 +461,19 @@ Takes a screenshot of any URL or HTML, downloads it and gives back the extracted
### `ExtractMhtml(options)`
Takes a screenshot of any URL or HTML, downloads it and gives back the extracted MHTML file as a string.

### `DownloadAsBase64(options)`
### `DownloadAsBase64(options)`
Gets a render link, runs a GET to that link to render your screenshot, then downloads the screenshot file as a Base64 string.

### `DownloadToFile(options, filePath)`
### `DownloadToFile(options, filePath)`
Gets a render link, runs a GET to that link to render your screenshot, then downloads and stores the screenshot to the given filePath.

### `GeneratePNGUrl(options)`
### `GeneratePNGUrl(options)`
Gets a render link for a screenshot in PNG format.

### `GenerateJPEGUrl(options)`
### `GenerateJPEGUrl(options)`
Gets a render link for a screenshot in JPEG format.

### `GeneratePDFUrl(options)`
### `GeneratePDFUrl(options)`
Gets a render link for a screenshot in PDF format.

# Popular Use Cases
Expand Down Expand Up @@ -507,7 +507,7 @@ SyncUrlboxResponse response = await urlbox.Render(options);
```
This will render you a full page MP4 as the example below shows:

### [Example MP4 (Full Page)](../Examples/mp4.mp4)
### [Example MP4 (Full Page)](Assets/mp4.mp4)

## Taking a Mobile view screenshot

Expand All @@ -525,7 +525,7 @@ SyncUrlboxResponse response = await urlbox.Render(options);

Which should render you something like the below example:

![](/Examples/mobile.png)
![](/Assets/mobile.png)

## Failing a request on 4XX-5XX

Expand All @@ -544,7 +544,7 @@ SyncUrlboxResponse response = await urlbox.Render(options);

This can save you renders over the month, particularly when tackling websites like tricky social media pages.

If there is a failure, it will give you back a [UrlboxException](#urlboxexception).
If there is a failure, it will give you back a [UrlboxException](#urlboxexception).

## Extracting Markdown/Metadata/HTML

Expand Down Expand Up @@ -607,7 +607,7 @@ SyncUrlboxResponse response = await urlbox.Render(options);

This will take the ID selector ".octicon-mark-github", and return a screenshot that looks like this:

![](../Images/gh.png)
![](Images/gh.png)

## Uploading to the cloud via an S3 bucket

Expand Down Expand Up @@ -671,11 +671,11 @@ Go to your [projects](https://urlbox.com/dashboard/projects) page, select a proj
Urlbox urlbox = Urlbox.FromCredentials("YOUR_KEY", "YOUR_SECRET", "YOUR_WEBHOOK_SECRET");
```

### 3. Make a request through any of our rendering methods.
### 3. Make a request through any of our rendering methods.

The most common use case for a webhook is when you need to use the `/async` endpoint to handle a larger render.

If you're developing locally, we would recommend using a service like [ngrok](https://ngrok.com/), and setting your webhook URL in the options to that ngrok endpoint.
If you're developing locally, we would recommend using a service like [ngrok](https://ngrok.com/), and setting your webhook URL in the options to that ngrok endpoint.

After you've added the endpoint, for example at the endpoint `/webhooks/urlbox`, make a request to that endpoint like this:

Expand Down Expand Up @@ -734,7 +734,7 @@ Below is a brief description of every publicly available method our SDK provides
### Static Methods
- **`static Urlbox FromCredentials(string apiKey, string apiSecret, string webhookSecret)`**
Creates a new instance of the Urlbox class using the specified API key, secret, and optional webhook secret.

- **`static UrlboxOptionsBuilder Options(string? url = null, string? html = null)`**
Creates a new instance of the Urlbox options builder. Requires a URL or HTML in the constructor to get started.

Expand All @@ -761,11 +761,11 @@ Below is a brief description of every publicly available method our SDK provides
- **`Task<AsyncUrlboxResponse> TakeScreenshotWithMetadata(UrlboxOptions options);`**
Asynchronously takes a screenshot and includes metadata in the response.

- **`Task<SyncUrlboxResponse> Render(UrlboxOptions options);`**
- **`Task<SyncUrlboxResponse> Render(UrlboxOptions options);`**
- **`Task<SyncUrlboxResponse> Render(IDictionary<string, object> options);`**
Sends a synchronous request to generate a render with the provided options, returning a direct response.

- **`Task<AsyncUrlboxResponse> RenderAsync(UrlboxOptions options);`**
- **`Task<AsyncUrlboxResponse> RenderAsync(UrlboxOptions options);`**
- **`Task<AsyncUrlboxResponse> RenderAsync(IDictionary<string, object> options);`**
Sends an asynchronous render request, providing a status URL for polling until completion.

Expand Down Expand Up @@ -800,7 +800,7 @@ Below is a brief description of every publicly available method our SDK provides

- **`string GenerateRenderLink(UrlboxOptions options, string format = "png", bool sign = true);`**
Constructs an Urlbox URL for the specified format and options.

- **`string GenerateSignedRenderLink(UrlboxOptions options, string format = "png");`**
Constructs an Urlbox URL for the specified format and options signed with the consumer's secret token.

Expand Down Expand Up @@ -930,10 +930,10 @@ WaitUntil - one of `Domloaded`, `Loaded`, `Mostrequestsfinished`, `Requestsfinis

## Examples

### [Example HTML](../Examples/html.html)
### [Example PDF](../Examples/pdf.pdf)
### [Example PDF Highlighting](../Examples/highlight.pdf)
### [Example PNG injecting Javascript](../Examples/javascript.png)
### [Example HTML](Assets/html.html)
### [Example PDF](Assets/pdf.pdf)
### [Example PDF Highlighting](Assets/highlight.pdf)
### [Example PNG injecting Javascript](Assets/javascript.png)

## Feedback

Expand Down Expand Up @@ -962,7 +962,7 @@ Get rendering!
Methods in previous versions of this SDK that would accept a Dictionary now take a standardised `UrlboxOptions` type.

- 1.0.2 - Further Updates to readme.

- 1.0.1 - Update Readme to replace instances of .io with .com.

- 1.0.0 - First release!
12 changes: 6 additions & 6 deletions UrlboxSDK/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ SyncUrlboxResponse response = await urlbox.Render(options);
```
This will render you a full page MP4 as the example below shows:

### [Example MP4 (Full Page)](../Examples/mp4.mp4)
### [Example MP4 (Full Page)](../Assets/mp4.mp4)

## Taking a Mobile view screenshot

Expand All @@ -525,7 +525,7 @@ SyncUrlboxResponse response = await urlbox.Render(options);

Which should render you something like the below example:

![](/Examples/mobile.png)
![](/Assets/mobile.png)

## Failing a request on 4XX-5XX

Expand Down Expand Up @@ -930,10 +930,10 @@ WaitUntil - one of `Domloaded`, `Loaded`, `Mostrequestsfinished`, `Requestsfinis

## Examples

### [Example HTML](../Examples/html.html)
### [Example PDF](../Examples/pdf.pdf)
### [Example PDF Highlighting](../Examples/highlight.pdf)
### [Example PNG injecting Javascript](../Examples/javascript.png)
### [Example HTML](../Assets/html.html)
### [Example PDF](../Assets/pdf.pdf)
### [Example PDF Highlighting](../Assets/highlight.pdf)
### [Example PNG injecting Javascript](../Assets/javascript.png)

## Feedback

Expand Down

0 comments on commit a05536e

Please sign in to comment.