htmlcsstoimage-api 0.1.4 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -1
- data/README.md +180 -10
- data/htmlcsstoimage.gemspec +4 -2
- data/lib/htmlcsstoimage/client.rb +36 -0
- data/lib/htmlcsstoimage/images.rb +173 -0
- data/lib/htmlcsstoimage/signed_urls.rb +130 -0
- data/lib/htmlcsstoimage/templates.rb +99 -0
- data/lib/htmlcsstoimage/version.rb +2 -1
- data/lib/htmlcsstoimage.rb +7 -151
- metadata +23 -29
- data/cassettes/HTMLCSSToImage/_create_image/accepts_additional_params.yml +0 -66
- data/cassettes/HTMLCSSToImage/_create_image/creates_an_image.yml +0 -64
- data/cassettes/HTMLCSSToImage/_create_template/creates_a_new_template.yml +0 -62
- data/cassettes/HTMLCSSToImage/_delete_image/deletes_an_image.yml +0 -60
- data/cassettes/HTMLCSSToImage/_templates/retrieves_templates.yml +0 -110
- data/cassettes/HTMLCSSToImage/_url_to_image/accepts_additional_params.yml +0 -64
- data/cassettes/HTMLCSSToImage/_url_to_image/creates_an_image_from_a_url.yml +0 -64
- data/docs/HTMLCSSToImage/ApiResponse.html +0 -124
- data/docs/HTMLCSSToImage.html +0 -1340
- data/docs/_config.yml +0 -1
- data/docs/_index.html +0 -122
- data/docs/class_list.html +0 -51
- data/docs/css/common.css +0 -1
- data/docs/css/full_list.css +0 -58
- data/docs/css/style.css +0 -496
- data/docs/file.README.html +0 -187
- data/docs/file_list.html +0 -56
- data/docs/frames.html +0 -17
- data/docs/index.html +0 -187
- data/docs/js/app.js +0 -314
- data/docs/js/full_list.js +0 -216
- data/docs/js/jquery.js +0 -4
- data/docs/method_list.html +0 -107
- data/docs/top-level-namespace.html +0 -110
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
class HTMLCSSToImage
|
|
2
|
+
# Retrieves saved templates.
|
|
3
|
+
#
|
|
4
|
+
# @see https://docs.htmlcsstoimage.com/getting-started/templates/
|
|
5
|
+
#
|
|
6
|
+
# @param params [Hash] pagination options
|
|
7
|
+
# @option params [Integer] :count number of templates to return, up to 100
|
|
8
|
+
# @option params [Integer] :max_version pagination cursor returned by the previous request
|
|
9
|
+
# @return [HTMLCSSToImage::ApiResponse] paginated template response
|
|
10
|
+
def list_templates(params = {})
|
|
11
|
+
self.class.get(
|
|
12
|
+
"/v1/template",
|
|
13
|
+
basic_auth: @auth,
|
|
14
|
+
query: params
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Compatibility proxy for {#list_templates}.
|
|
19
|
+
#
|
|
20
|
+
# @param params [Hash] pagination options
|
|
21
|
+
# @return [HTMLCSSToImage::ApiResponse] paginated template response
|
|
22
|
+
def templates(params = {})
|
|
23
|
+
list_templates(params)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Retrieves versions of a saved template.
|
|
27
|
+
#
|
|
28
|
+
# @see https://docs.htmlcsstoimage.com/getting-started/templates/
|
|
29
|
+
#
|
|
30
|
+
# @param template_id [String] the saved template ID
|
|
31
|
+
# @param params [Hash] pagination options
|
|
32
|
+
# @option params [Integer] :count number of versions to return, up to 100
|
|
33
|
+
# @option params [Integer] :max_version pagination cursor returned by the previous request
|
|
34
|
+
# @return [HTMLCSSToImage::ApiResponse] paginated template version response
|
|
35
|
+
def list_template_versions(template_id, params = {})
|
|
36
|
+
self.class.get(
|
|
37
|
+
"/v1/template/#{template_id}",
|
|
38
|
+
basic_auth: @auth,
|
|
39
|
+
query: params
|
|
40
|
+
)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Creates an image template.
|
|
44
|
+
#
|
|
45
|
+
# @see https://docs.htmlcsstoimage.com/getting-started/templates/
|
|
46
|
+
#
|
|
47
|
+
# @param html [String] HTML for the template
|
|
48
|
+
# @param params [Hash] template and rendering options
|
|
49
|
+
# @option params [String] :name A short name to identify the template. Maximum length: 64.
|
|
50
|
+
# @option params [String] :description A description of the template. Maximum length: 1024.
|
|
51
|
+
# @option params [String] :css The CSS for the template.
|
|
52
|
+
# @option params [Numeric] :device_scale The pixel ratio for the screenshot. Minimum: `0.1`, Maximum: `3`.
|
|
53
|
+
# @option params [String] :google_fonts Google Fonts to load. Separate multiple fonts with `|`.
|
|
54
|
+
# @option params [Integer] :max_wait_ms The maximum time to wait before taking the screenshot. Minimum: `500`, Maximum: `10000`.
|
|
55
|
+
# @option params [Integer] :ms_delay Extra time in milliseconds to wait before taking the screenshot. Maximum: `10000`.
|
|
56
|
+
# @option params [Boolean] :render_when_ready Wait until `ScreenshotReady()` is called from JavaScript before taking the screenshot.
|
|
57
|
+
# @option params [Boolean] :max_render_once Ensure images created from the template are only rendered and saved once.
|
|
58
|
+
# @option params [String] :selector A CSS selector for the element to capture.
|
|
59
|
+
# @option params [Integer] :viewport_height The Chrome viewport height. Both viewport dimensions must be set if using either.
|
|
60
|
+
# @option params [Integer] :viewport_width The Chrome viewport width. Both viewport dimensions must be set if using either.
|
|
61
|
+
# @option params [Boolean] :disable_twemoji Disable the Twemoji fallback and use native emoji fonts.
|
|
62
|
+
# @option params [String] :color_scheme Render using the `light` or `dark` browser color scheme.
|
|
63
|
+
# @option params [String] :timezone The browser timezone as an IANA timezone identifier, such as `America/New_York`.
|
|
64
|
+
# @option params [Boolean] :viewport_mobile Whether to honor the page's mobile viewport behavior.
|
|
65
|
+
# @option params [Boolean] :viewport_landscape Whether to render the viewport in landscape mode.
|
|
66
|
+
# @option params [Boolean] :viewport_touch Whether the viewport supports touch events.
|
|
67
|
+
# @option params [String] :media_type Render using `print` or `screen` media.
|
|
68
|
+
# @option params [Integer] :jumbo_max_height Maximum output height in jumbo mode. Requires `jumbo_max_width`.
|
|
69
|
+
# @option params [Integer] :jumbo_max_width Maximum output width in jumbo mode. Requires `jumbo_max_height`.
|
|
70
|
+
# @option params [String] :proxy_id The ID of an organization proxy to use for the render.
|
|
71
|
+
# @option params [String] :storage_destination_id The ID of an organization storage destination inherited by images created from the template.
|
|
72
|
+
# @option params [Boolean] :transparent_background Whether images created from the template should use a transparent background.
|
|
73
|
+
# @return [HTMLCSSToImage::ApiResponse] created template details
|
|
74
|
+
def create_template(html, params = {})
|
|
75
|
+
create_template_at_path("/v1/template", html, params)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Creates a new version of a saved template.
|
|
79
|
+
#
|
|
80
|
+
# Accepts the same options as {#create_template}.
|
|
81
|
+
#
|
|
82
|
+
# @see https://docs.htmlcsstoimage.com/getting-started/templates/
|
|
83
|
+
#
|
|
84
|
+
# @param template_id [String] the saved template ID
|
|
85
|
+
# @param html [String] HTML for the new template version
|
|
86
|
+
# @param params [Hash] template and rendering options
|
|
87
|
+
# @return [HTMLCSSToImage::ApiResponse] created template version details
|
|
88
|
+
def create_template_version(template_id, html, params = {})
|
|
89
|
+
create_template_at_path("/v1/template/#{template_id}", html, params)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
private
|
|
93
|
+
|
|
94
|
+
def create_template_at_path(path, html, params)
|
|
95
|
+
body = { html: html }.merge(params).to_json
|
|
96
|
+
|
|
97
|
+
self.class.post(path, basic_auth: @auth, body: body)
|
|
98
|
+
end
|
|
99
|
+
end
|
data/lib/htmlcsstoimage.rb
CHANGED
|
@@ -1,155 +1,11 @@
|
|
|
1
1
|
require "htmlcsstoimage/version"
|
|
2
|
+
require "json"
|
|
3
|
+
require "openssl"
|
|
2
4
|
require "httparty"
|
|
3
|
-
require "addressable"
|
|
5
|
+
require "addressable/uri"
|
|
4
6
|
require "ostruct"
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
format :json
|
|
11
|
-
|
|
12
|
-
SIGNED_URL_TEMPLATE = Addressable::Template.new("https://hcti.io/v1/image/{template_id}/{signed_token}{/format*}{?query*}")
|
|
13
|
-
|
|
14
|
-
class ApiResponse < OpenStruct
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
parser(
|
|
18
|
-
proc do |body, format|
|
|
19
|
-
case format
|
|
20
|
-
when :json
|
|
21
|
-
JSON.parse(body, object_class: ApiResponse)
|
|
22
|
-
else
|
|
23
|
-
body
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
# Creates an instance of HTMLCSSToImage with API credentials.
|
|
29
|
-
# If credentials are not provided, will try to use environment variables.
|
|
30
|
-
# `HCTI_USER_ID` and `HCTI_API_KEY`.
|
|
31
|
-
#
|
|
32
|
-
# @see https://htmlcsstoimage.com/dashboard
|
|
33
|
-
#
|
|
34
|
-
# @param user_id [String] the user_id for the account.
|
|
35
|
-
# @param api_key [String] the api_key for the account.
|
|
36
|
-
# @return [HTMLCSSToImage] an instance of the api client.
|
|
37
|
-
def initialize(user_id: ENV["HCTI_USER_ID"], api_key: ENV["HCTI_API_KEY"])
|
|
38
|
-
@auth = { username: user_id, password: api_key }
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
# Converts HTML/CSS to an image with the API
|
|
42
|
-
#
|
|
43
|
-
# @see https://docs.htmlcsstoimage.com/getting-started/using-the-api
|
|
44
|
-
#
|
|
45
|
-
# @param html [String] This is the HTML you want to render. You can send an HTML snippet (`<div>Your content</div>`) or an entire webpage.
|
|
46
|
-
#
|
|
47
|
-
# @option params [String] :css The CSS for your image.
|
|
48
|
-
# @option params [String] :google_fonts [Google fonts](https://docs.htmlcsstoimage.com/guides/using-google-fonts/) to be loaded. Example: `Roboto`. Multiple fonts can be loaded like this: `Roboto|Open Sans`
|
|
49
|
-
# @option params [String] :selector A CSS selector for an element on the webpage. We'll crop the image to this specific element. For example: `section#complete-toolkit.container-lg`
|
|
50
|
-
# @option params [Integer] :ms_delay The number of milliseconds the API should delay before generating the image. This is useful when waiting for JavaScript. We recommend starting with `500`. Large values slow down the initial render time.
|
|
51
|
-
# @option params [Double] :device_scale This adjusts the pixel ratio for the screenshot. Minimum: `1`, Maximum: `3`.
|
|
52
|
-
# @option params [Boolean] :render_when_ready Set to true to control when the image is generated. Call `ScreenshotReady()` from JavaScript to generate the image. [Learn more](https://docs.htmlcsstoimage.com/guides/render-when-ready/).
|
|
53
|
-
# @option params [Integer] :viewport_width Set the width of Chrome's viewport. This will disable automatic cropping. Both height and width parameters must be set if using either.
|
|
54
|
-
# @option params [Integer] :viewport_height Set the height of Chrome's viewport. This will disable automatic cropping. Both height and width parameters must be set if using either.
|
|
55
|
-
#
|
|
56
|
-
# @return [HTMLCSSToImage::ApiResponse] image URL available at `.url`.
|
|
57
|
-
def create_image(html, params = {})
|
|
58
|
-
body = { html: html }.merge(params).to_json
|
|
59
|
-
options = { basic_auth: @auth, body: body, query: { includeId: true } }
|
|
60
|
-
|
|
61
|
-
self.class.post("/v1/image", options)
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
# Deletes an image
|
|
65
|
-
#
|
|
66
|
-
# @see https://docs.htmlcsstoimage.com/getting-started/using-the-api
|
|
67
|
-
#
|
|
68
|
-
# @param image_id [String] The ID for the image you would like to delete
|
|
69
|
-
def delete_image(image_id)
|
|
70
|
-
response = self.class.delete("/v1/image/#{image_id}", basic_auth: @auth)
|
|
71
|
-
|
|
72
|
-
return true if response.success?
|
|
73
|
-
|
|
74
|
-
response
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
# Creates a signed URL for generating an image from a template
|
|
78
|
-
# This URL contains the template_values in it. It is signed with HMAC so that it cannot be changed
|
|
79
|
-
# by anyone without the API Key.
|
|
80
|
-
#
|
|
81
|
-
# Does not make any network requests.
|
|
82
|
-
#
|
|
83
|
-
# @see https://docs.htmlcsstoimage.com/getting-started/using-the-api
|
|
84
|
-
#
|
|
85
|
-
# @param template_id [String] The ID for the template
|
|
86
|
-
# @param template_values [Hash] A hash containing the values to replace in the template
|
|
87
|
-
def create_image_from_template(template_id, template_values = {}, params = {})
|
|
88
|
-
template = SIGNED_URL_TEMPLATE.partial_expand({
|
|
89
|
-
template_id: template_id,
|
|
90
|
-
query: template_values
|
|
91
|
-
})
|
|
92
|
-
|
|
93
|
-
query = Addressable::URI.parse(template.expand(signed_token: nil).to_s).query
|
|
94
|
-
digest = OpenSSL::Digest.new('sha256')
|
|
95
|
-
signed_token = OpenSSL::HMAC.hexdigest(digest, @auth[:password], CGI.unescape(query))
|
|
96
|
-
|
|
97
|
-
url = template.expand({
|
|
98
|
-
signed_token: signed_token
|
|
99
|
-
}).to_s
|
|
100
|
-
|
|
101
|
-
ApiResponse.new(url: url)
|
|
102
|
-
end
|
|
103
|
-
|
|
104
|
-
# Generate a screenshot of a URL
|
|
105
|
-
#
|
|
106
|
-
# @see https://docs.htmlcsstoimage.com/getting-started/url-to-image/
|
|
107
|
-
#
|
|
108
|
-
# @param url [String] The fully qualified URL to a public webpage. Such as https://htmlcsstoimage.com.
|
|
109
|
-
# @option params [String] :css The CSS for your image. Gets injected into the webpage.
|
|
110
|
-
# @option params [String] :selector A CSS selector for an element on the webpage. We'll crop the image to this specific element. For example: `section#complete-toolkit.container-lg`
|
|
111
|
-
# @option params [Integer] :ms_delay The number of milliseconds the API should delay before generating the image. This is useful when waiting for JavaScript. We recommend starting with `500`. Large values slow down the initial render time.
|
|
112
|
-
# @option params [Double] :device_scale This adjusts the pixel ratio for the screenshot. Minimum: `1`, Maximum: `3`.
|
|
113
|
-
# @option params [Boolean] :render_when_ready Set to true to control when the image is generated. Call `ScreenshotReady()` from JavaScript to generate the image. [Learn more](https://docs.htmlcsstoimage.com/guides/render-when-ready/).
|
|
114
|
-
# @option params [Integer] :viewport_width Set the width of Chrome's viewport. This will disable automatic cropping. Both height and width parameters must be set if using either.
|
|
115
|
-
# @option params [Integer] :viewport_height Set the height of Chrome's viewport. This will disable automatic cropping. Both height and width parameters must be set if using either.
|
|
116
|
-
def url_to_image(url, params = {})
|
|
117
|
-
body = { url: url }.merge(params).to_json
|
|
118
|
-
options = { basic_auth: @auth, body: body, query: { includeId: true } }
|
|
119
|
-
|
|
120
|
-
self.class.post("/v1/image", options)
|
|
121
|
-
end
|
|
122
|
-
|
|
123
|
-
# Retrieves all available templates
|
|
124
|
-
#
|
|
125
|
-
# @see https://docs.htmlcsstoimage.com/getting-started/templates/
|
|
126
|
-
def templates(params = {})
|
|
127
|
-
options = params.merge({ basic_auth: @auth })
|
|
128
|
-
self.class.get("/v1/template", options)
|
|
129
|
-
end
|
|
130
|
-
|
|
131
|
-
# Creates an image template
|
|
132
|
-
#
|
|
133
|
-
# @see https://docs.htmlcsstoimage.com/getting-started/templates/
|
|
134
|
-
#
|
|
135
|
-
# @param html [String] This is the HTML you want to render. You can send an HTML snippet (`<div>Your content</div>`) or an entire webpage.
|
|
136
|
-
#
|
|
137
|
-
# @option params [String] :name A short name to identify your template max length 64
|
|
138
|
-
# @option params [String] :description Description to elaborate on the use of your template max length 1024
|
|
139
|
-
# @option params [String] :css The CSS for your image.
|
|
140
|
-
# @option params [String] :google_fonts [Google fonts](https://docs.htmlcsstoimage.com/guides/using-google-fonts/) to be loaded. Example: `Roboto`. Multiple fonts can be loaded like this: `Roboto|Open Sans`
|
|
141
|
-
# @option params [String] :selector A CSS selector for an element on the webpage. We'll crop the image to this specific element. For example: `section#complete-toolkit.container-lg`
|
|
142
|
-
# @option params [Integer] :ms_delay The number of milliseconds the API should delay before generating the image. This is useful when waiting for JavaScript. We recommend starting with `500`. Large values slow down the initial render time.
|
|
143
|
-
# @option params [Double] :device_scale This adjusts the pixel ratio for the screenshot. Minimum: `1`, Maximum: `3`.
|
|
144
|
-
# @option params [Boolean] :render_when_ready Set to true to control when the image is generated. Call `ScreenshotReady()` from JavaScript to generate the image. [Learn more](https://docs.htmlcsstoimage.com/guides/render-when-ready/).
|
|
145
|
-
# @option params [Integer] :viewport_width Set the width of Chrome's viewport. This will disable automatic cropping. Both height and width parameters must be set if using either.
|
|
146
|
-
# @option params [Integer] :viewport_height Set the height of Chrome's viewport. This will disable automatic cropping. Both height and width parameters must be set if using either.
|
|
147
|
-
#
|
|
148
|
-
# @return [HTMLCSSToImage::ApiResponse] image URL available at `.url`.
|
|
149
|
-
def create_template(html, params = {})
|
|
150
|
-
body = { html: html }.merge(params).to_json
|
|
151
|
-
options = { basic_auth: @auth, body: body }
|
|
152
|
-
|
|
153
|
-
self.class.post("/v1/template", options)
|
|
154
|
-
end
|
|
155
|
-
end
|
|
8
|
+
require "htmlcsstoimage/client"
|
|
9
|
+
require "htmlcsstoimage/images"
|
|
10
|
+
require "htmlcsstoimage/signed_urls"
|
|
11
|
+
require "htmlcsstoimage/templates"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: htmlcsstoimage-api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mike Coutermarsh
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: exe
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2026-09-01 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: httparty
|
|
@@ -137,8 +137,22 @@ dependencies:
|
|
|
137
137
|
- - ">="
|
|
138
138
|
- !ruby/object:Gem::Version
|
|
139
139
|
version: '0'
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
- !ruby/object:Gem::Dependency
|
|
141
|
+
name: yard
|
|
142
|
+
requirement: !ruby/object:Gem::Requirement
|
|
143
|
+
requirements:
|
|
144
|
+
- - "~>"
|
|
145
|
+
- !ruby/object:Gem::Version
|
|
146
|
+
version: '0.9'
|
|
147
|
+
type: :development
|
|
148
|
+
prerelease: false
|
|
149
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
150
|
+
requirements:
|
|
151
|
+
- - "~>"
|
|
152
|
+
- !ruby/object:Gem::Version
|
|
153
|
+
version: '0.9'
|
|
154
|
+
description: 'Ruby client for the HTML/CSS to Image API. Generate PNG, JPG, WebP,
|
|
155
|
+
or PDF files with Ruby. Renders exactly like Google Chrome. '
|
|
142
156
|
email:
|
|
143
157
|
- support@htmlcsstoimage.com
|
|
144
158
|
executables: []
|
|
@@ -158,32 +172,12 @@ files:
|
|
|
158
172
|
- Rakefile
|
|
159
173
|
- bin/console
|
|
160
174
|
- bin/setup
|
|
161
|
-
- cassettes/HTMLCSSToImage/_create_image/accepts_additional_params.yml
|
|
162
|
-
- cassettes/HTMLCSSToImage/_create_image/creates_an_image.yml
|
|
163
|
-
- cassettes/HTMLCSSToImage/_create_template/creates_a_new_template.yml
|
|
164
|
-
- cassettes/HTMLCSSToImage/_delete_image/deletes_an_image.yml
|
|
165
|
-
- cassettes/HTMLCSSToImage/_templates/retrieves_templates.yml
|
|
166
|
-
- cassettes/HTMLCSSToImage/_url_to_image/accepts_additional_params.yml
|
|
167
|
-
- cassettes/HTMLCSSToImage/_url_to_image/creates_an_image_from_a_url.yml
|
|
168
|
-
- docs/HTMLCSSToImage.html
|
|
169
|
-
- docs/HTMLCSSToImage/ApiResponse.html
|
|
170
|
-
- docs/_config.yml
|
|
171
|
-
- docs/_index.html
|
|
172
|
-
- docs/class_list.html
|
|
173
|
-
- docs/css/common.css
|
|
174
|
-
- docs/css/full_list.css
|
|
175
|
-
- docs/css/style.css
|
|
176
|
-
- docs/file.README.html
|
|
177
|
-
- docs/file_list.html
|
|
178
|
-
- docs/frames.html
|
|
179
|
-
- docs/index.html
|
|
180
|
-
- docs/js/app.js
|
|
181
|
-
- docs/js/full_list.js
|
|
182
|
-
- docs/js/jquery.js
|
|
183
|
-
- docs/method_list.html
|
|
184
|
-
- docs/top-level-namespace.html
|
|
185
175
|
- htmlcsstoimage.gemspec
|
|
186
176
|
- lib/htmlcsstoimage.rb
|
|
177
|
+
- lib/htmlcsstoimage/client.rb
|
|
178
|
+
- lib/htmlcsstoimage/images.rb
|
|
179
|
+
- lib/htmlcsstoimage/signed_urls.rb
|
|
180
|
+
- lib/htmlcsstoimage/templates.rb
|
|
187
181
|
- lib/htmlcsstoimage/version.rb
|
|
188
182
|
homepage: https://docs.htmlcsstoimage.com/example-code/ruby
|
|
189
183
|
licenses:
|
|
@@ -197,7 +191,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
197
191
|
requirements:
|
|
198
192
|
- - ">="
|
|
199
193
|
- !ruby/object:Gem::Version
|
|
200
|
-
version:
|
|
194
|
+
version: 2.7.0
|
|
201
195
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
202
196
|
requirements:
|
|
203
197
|
- - ">="
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
http_interactions:
|
|
3
|
-
- request:
|
|
4
|
-
method: post
|
|
5
|
-
uri: https://hcti.io/v1/image?includeId=true
|
|
6
|
-
body:
|
|
7
|
-
encoding: UTF-8
|
|
8
|
-
string: '{"html":"<div>test</div>","css":"body { background-color: orange }","ms_delay":500,"google_fonts":"Roboto"}'
|
|
9
|
-
headers:
|
|
10
|
-
Content-Type:
|
|
11
|
-
- application/json
|
|
12
|
-
Accept-Encoding:
|
|
13
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
|
14
|
-
Accept:
|
|
15
|
-
- "*/*"
|
|
16
|
-
User-Agent:
|
|
17
|
-
- Ruby
|
|
18
|
-
Authorization:
|
|
19
|
-
- Basic authentication-header
|
|
20
|
-
response:
|
|
21
|
-
status:
|
|
22
|
-
code: 200
|
|
23
|
-
message: OK
|
|
24
|
-
headers:
|
|
25
|
-
Date:
|
|
26
|
-
- Fri, 07 Aug 2020 16:26:02 GMT
|
|
27
|
-
Content-Type:
|
|
28
|
-
- application/json; charset=utf-8
|
|
29
|
-
Transfer-Encoding:
|
|
30
|
-
- chunked
|
|
31
|
-
Connection:
|
|
32
|
-
- keep-alive
|
|
33
|
-
Set-Cookie:
|
|
34
|
-
- __cfduid=d2514bf66b55358e89144d7ce2e05ca431596817562; expires=Sun, 06-Sep-20
|
|
35
|
-
16:26:02 GMT; path=/; domain=.hcti.io; HttpOnly; SameSite=Lax
|
|
36
|
-
Cf-Ray:
|
|
37
|
-
- 5bf25b63d9e06d52-SJC
|
|
38
|
-
Access-Control-Allow-Origin:
|
|
39
|
-
- "*"
|
|
40
|
-
Age:
|
|
41
|
-
- '235'
|
|
42
|
-
Cache-Control:
|
|
43
|
-
- max-age=14400, 31536000
|
|
44
|
-
Vary:
|
|
45
|
-
- Accept-Encoding
|
|
46
|
-
Cf-Cache-Status:
|
|
47
|
-
- HIT
|
|
48
|
-
Cf-Request-Id:
|
|
49
|
-
- 046b57726600006d5284153200000001
|
|
50
|
-
Expect-Ct:
|
|
51
|
-
- max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
|
|
52
|
-
Request-Context:
|
|
53
|
-
- appId=cid-v1:ef200074-f922-49b8-a889-360bb27d5561
|
|
54
|
-
X-Is-Overage:
|
|
55
|
-
- 'False'
|
|
56
|
-
X-Renders-Allowed:
|
|
57
|
-
- '500000'
|
|
58
|
-
X-Renders-Used:
|
|
59
|
-
- '4539'
|
|
60
|
-
Server:
|
|
61
|
-
- cloudflare
|
|
62
|
-
body:
|
|
63
|
-
encoding: ASCII-8BIT
|
|
64
|
-
string: '{"url":"https://hcti.io/v1/image/254b444c-dd82-4cc1-94ef-aa4b3a6870a6","id":"254b444c-dd82-4cc1-94ef-aa4b3a6870a6"}'
|
|
65
|
-
recorded_at: Fri, 07 Aug 2020 16:26:02 GMT
|
|
66
|
-
recorded_with: VCR 6.0.0
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
http_interactions:
|
|
3
|
-
- request:
|
|
4
|
-
method: post
|
|
5
|
-
uri: https://hcti.io/v1/image?includeId=true
|
|
6
|
-
body:
|
|
7
|
-
encoding: UTF-8
|
|
8
|
-
string: '{"html":"<div>test</div>"}'
|
|
9
|
-
headers:
|
|
10
|
-
Content-Type:
|
|
11
|
-
- application/json
|
|
12
|
-
Accept-Encoding:
|
|
13
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
|
14
|
-
Accept:
|
|
15
|
-
- "*/*"
|
|
16
|
-
User-Agent:
|
|
17
|
-
- Ruby
|
|
18
|
-
Authorization:
|
|
19
|
-
- Basic authentication-header
|
|
20
|
-
response:
|
|
21
|
-
status:
|
|
22
|
-
code: 200
|
|
23
|
-
message: OK
|
|
24
|
-
headers:
|
|
25
|
-
Date:
|
|
26
|
-
- Fri, 07 Aug 2020 16:26:01 GMT
|
|
27
|
-
Content-Type:
|
|
28
|
-
- application/json; charset=utf-8
|
|
29
|
-
Transfer-Encoding:
|
|
30
|
-
- chunked
|
|
31
|
-
Connection:
|
|
32
|
-
- keep-alive
|
|
33
|
-
Set-Cookie:
|
|
34
|
-
- __cfduid=d3a44d4dbf2273232e5acce7284a8582e1596817561; expires=Sun, 06-Sep-20
|
|
35
|
-
16:26:01 GMT; path=/; domain=.hcti.io; HttpOnly; SameSite=Lax
|
|
36
|
-
Cf-Ray:
|
|
37
|
-
- 5bf25b61183a93be-SJC
|
|
38
|
-
Access-Control-Allow-Origin:
|
|
39
|
-
- "*"
|
|
40
|
-
Cache-Control:
|
|
41
|
-
- max-age=public, 31536000
|
|
42
|
-
Vary:
|
|
43
|
-
- Accept-Encoding
|
|
44
|
-
Cf-Cache-Status:
|
|
45
|
-
- DYNAMIC
|
|
46
|
-
Cf-Request-Id:
|
|
47
|
-
- 046b5770aa000093be5f243200000001
|
|
48
|
-
Expect-Ct:
|
|
49
|
-
- max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
|
|
50
|
-
Request-Context:
|
|
51
|
-
- appId=cid-v1:ef200074-f922-49b8-a889-360bb27d5561
|
|
52
|
-
X-Is-Overage:
|
|
53
|
-
- 'False'
|
|
54
|
-
X-Renders-Allowed:
|
|
55
|
-
- '500000'
|
|
56
|
-
X-Renders-Used:
|
|
57
|
-
- '4539'
|
|
58
|
-
Server:
|
|
59
|
-
- cloudflare
|
|
60
|
-
body:
|
|
61
|
-
encoding: ASCII-8BIT
|
|
62
|
-
string: '{"url":"https://hcti.io/v1/image/b1021edd-0af3-4764-9a1c-6d9eae18985d","id":"b1021edd-0af3-4764-9a1c-6d9eae18985d"}'
|
|
63
|
-
recorded_at: Fri, 07 Aug 2020 16:26:02 GMT
|
|
64
|
-
recorded_with: VCR 6.0.0
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
http_interactions:
|
|
3
|
-
- request:
|
|
4
|
-
method: post
|
|
5
|
-
uri: https://hcti.io/v1/template
|
|
6
|
-
body:
|
|
7
|
-
encoding: UTF-8
|
|
8
|
-
string: '{"html":"<div>{{title}}</div>"}'
|
|
9
|
-
headers:
|
|
10
|
-
Content-Type:
|
|
11
|
-
- application/json
|
|
12
|
-
Accept-Encoding:
|
|
13
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
|
14
|
-
Accept:
|
|
15
|
-
- "*/*"
|
|
16
|
-
User-Agent:
|
|
17
|
-
- Ruby
|
|
18
|
-
Authorization:
|
|
19
|
-
- Basic authentication-header
|
|
20
|
-
response:
|
|
21
|
-
status:
|
|
22
|
-
code: 200
|
|
23
|
-
message: OK
|
|
24
|
-
headers:
|
|
25
|
-
Date:
|
|
26
|
-
- Fri, 07 Aug 2020 19:36:19 GMT
|
|
27
|
-
Content-Type:
|
|
28
|
-
- application/json; charset=utf-8
|
|
29
|
-
Transfer-Encoding:
|
|
30
|
-
- chunked
|
|
31
|
-
Connection:
|
|
32
|
-
- keep-alive
|
|
33
|
-
Set-Cookie:
|
|
34
|
-
- AWSALB=8NnODxuzAe4Nb8xeygtwkJHJHF3lssQ/enmnhpDWIEnVBlUCGsJx7oOuPNoHhhnOmfAuosIx+goxLrCc65Bj5aHNLx2OQfAT2+s30zwTqYe68r9E92BliiwyFa5u;
|
|
35
|
-
Expires=Fri, 14 Aug 2020 19:36:19 GMT; Path=/
|
|
36
|
-
- AWSALBCORS=8NnODxuzAe4Nb8xeygtwkJHJHF3lssQ/enmnhpDWIEnVBlUCGsJx7oOuPNoHhhnOmfAuosIx+goxLrCc65Bj5aHNLx2OQfAT2+s30zwTqYe68r9E92BliiwyFa5u;
|
|
37
|
-
Expires=Fri, 14 Aug 2020 19:36:19 GMT; Path=/; SameSite=None
|
|
38
|
-
- __cfduid=d711e0d3ad7d037601f11d9cf3adf2b781596828978; expires=Sun, 06-Sep-20
|
|
39
|
-
19:36:18 GMT; path=/; domain=.hcti.io; HttpOnly; SameSite=Lax
|
|
40
|
-
- __cflb=0H28vWzHFPHZw4TS8VrB813a2Y9bcaGDgdxkfUiw3uN; SameSite=Lax; path=/;
|
|
41
|
-
expires=Sat, 08-Aug-20 18:36:19 GMT; HttpOnly
|
|
42
|
-
Cf-Ray:
|
|
43
|
-
- 5bf3721e3a64ed8b-SJC
|
|
44
|
-
Access-Control-Allow-Origin:
|
|
45
|
-
- "*"
|
|
46
|
-
Vary:
|
|
47
|
-
- Accept-Encoding
|
|
48
|
-
Cf-Cache-Status:
|
|
49
|
-
- DYNAMIC
|
|
50
|
-
Cf-Request-Id:
|
|
51
|
-
- 046c05a6e10000ed8b05ab1200000001
|
|
52
|
-
Expect-Ct:
|
|
53
|
-
- max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
|
|
54
|
-
Request-Context:
|
|
55
|
-
- appId=cid-v1:ef200074-f922-49b8-a889-360bb27d5561
|
|
56
|
-
Server:
|
|
57
|
-
- cloudflare
|
|
58
|
-
body:
|
|
59
|
-
encoding: ASCII-8BIT
|
|
60
|
-
string: '{"template_id":"t-5a518f6d-fc53-4c6a-96a1-34ef5ff89916","template_version":1596828979123}'
|
|
61
|
-
recorded_at: Fri, 07 Aug 2020 19:36:19 GMT
|
|
62
|
-
recorded_with: VCR 6.0.0
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
http_interactions:
|
|
3
|
-
- request:
|
|
4
|
-
method: delete
|
|
5
|
-
uri: https://hcti.io/v1/image/254b444c-dd82-4cc1-94ef-aa4b3a6870a6
|
|
6
|
-
body:
|
|
7
|
-
encoding: US-ASCII
|
|
8
|
-
string: ''
|
|
9
|
-
headers:
|
|
10
|
-
Content-Type:
|
|
11
|
-
- application/json
|
|
12
|
-
Accept-Encoding:
|
|
13
|
-
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
|
14
|
-
Accept:
|
|
15
|
-
- "*/*"
|
|
16
|
-
User-Agent:
|
|
17
|
-
- Ruby
|
|
18
|
-
Authorization:
|
|
19
|
-
- Basic authentication-header
|
|
20
|
-
response:
|
|
21
|
-
status:
|
|
22
|
-
code: 202
|
|
23
|
-
message: Accepted
|
|
24
|
-
headers:
|
|
25
|
-
Date:
|
|
26
|
-
- Fri, 07 Aug 2020 16:51:36 GMT
|
|
27
|
-
Content-Length:
|
|
28
|
-
- '0'
|
|
29
|
-
Connection:
|
|
30
|
-
- keep-alive
|
|
31
|
-
Set-Cookie:
|
|
32
|
-
- AWSALB=HZiSeVcPpOrp8Cnv2US5zfSSk4zfNJf/1l6T3PqVI3TgleMUP0b2nZb4TVAApvvUUVtxSVFXNdHGp+1mFZbuW/HdLu5+oJhsQGABcpZB1/81jltlZ915zAZsPiqQ;
|
|
33
|
-
Expires=Fri, 14 Aug 2020 16:51:36 GMT; Path=/
|
|
34
|
-
- AWSALBCORS=HZiSeVcPpOrp8Cnv2US5zfSSk4zfNJf/1l6T3PqVI3TgleMUP0b2nZb4TVAApvvUUVtxSVFXNdHGp+1mFZbuW/HdLu5+oJhsQGABcpZB1/81jltlZ915zAZsPiqQ;
|
|
35
|
-
Expires=Fri, 14 Aug 2020 16:51:36 GMT; Path=/; SameSite=None
|
|
36
|
-
- __cfduid=d2ba84d953b71c6632e925836ec9c13981596819096; expires=Sun, 06-Sep-20
|
|
37
|
-
16:51:36 GMT; path=/; domain=.hcti.io; HttpOnly; SameSite=Lax
|
|
38
|
-
- __cflb=0H28vWzHFPHZw4TS8VrB813a2Y9bcaFsXduaPonfK5N; SameSite=Lax; path=/;
|
|
39
|
-
expires=Sat, 08-Aug-20 15:51:36 GMT; HttpOnly
|
|
40
|
-
Cf-Ray:
|
|
41
|
-
- 5bf280d648daed17-SJC
|
|
42
|
-
Access-Control-Allow-Origin:
|
|
43
|
-
- "*"
|
|
44
|
-
Cf-Cache-Status:
|
|
45
|
-
- DYNAMIC
|
|
46
|
-
Cf-Request-Id:
|
|
47
|
-
- 046b6ed9eb0000ed17e9360200000001
|
|
48
|
-
Expect-Ct:
|
|
49
|
-
- max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
|
|
50
|
-
Request-Context:
|
|
51
|
-
- appId=cid-v1:ef200074-f922-49b8-a889-360bb27d5561
|
|
52
|
-
Vary:
|
|
53
|
-
- Accept-Encoding
|
|
54
|
-
Server:
|
|
55
|
-
- cloudflare
|
|
56
|
-
body:
|
|
57
|
-
encoding: UTF-8
|
|
58
|
-
string: ''
|
|
59
|
-
recorded_at: Fri, 07 Aug 2020 16:51:36 GMT
|
|
60
|
-
recorded_with: VCR 6.0.0
|