screenshots_pagepixels 1.0.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 +7 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/Gemfile +8 -0
- data/LICENSE.txt +21 -0
- data/README.md +205 -0
- data/Rakefile +4 -0
- data/lib/screenshots_pagepixels/client.rb +125 -0
- data/lib/screenshots_pagepixels/version.rb +5 -0
- data/lib/screenshots_pagepixels.rb +9 -0
- data/screenshots_pagepixels.gemspec +37 -0
- data/sig/screenshots_pagepixels.rbs +4 -0
- metadata +92 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 20a62b5eca4d9d981ceff650494787478b56810b4ddb30e543bc4a8aaee9aaeb
|
4
|
+
data.tar.gz: 82c12736d4dd429fa36023b6cc401bf92f3f59f0fb4d1d66b83b091f6e8ea4ea
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5cd44d16146cd75d9dc782bf1267af031b8c3103903a505d3d2aa9060f582fb26316d3ecbe45b4c02afa3315de00c023beb50c68db12e4910f511f1eaa4ee3fc
|
7
|
+
data.tar.gz: 5e689ddfd6067f07888571d2c1bd334a23bbe1d8542e6709df7312566cbbd3812ce90ae96889915328a141fd90c273abb67e610f75742aa6c36334dd38e8de25
|
data/CHANGELOG.md
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
6
|
+
|
7
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
8
|
+
|
9
|
+
## Our Standards
|
10
|
+
|
11
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
12
|
+
|
13
|
+
* Demonstrating empathy and kindness toward other people
|
14
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
15
|
+
* Giving and gracefully accepting constructive feedback
|
16
|
+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
17
|
+
* Focusing on what is best not just for us as individuals, but for the overall community
|
18
|
+
|
19
|
+
Examples of unacceptable behavior include:
|
20
|
+
|
21
|
+
* The use of sexualized language or imagery, and sexual attention or
|
22
|
+
advances of any kind
|
23
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
24
|
+
* Public or private harassment
|
25
|
+
* Publishing others' private information, such as a physical or email
|
26
|
+
address, without their explicit permission
|
27
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
28
|
+
professional setting
|
29
|
+
|
30
|
+
## Enforcement Responsibilities
|
31
|
+
|
32
|
+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
33
|
+
|
34
|
+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
35
|
+
|
36
|
+
## Scope
|
37
|
+
|
38
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
39
|
+
|
40
|
+
## Enforcement
|
41
|
+
|
42
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at occamsfreelance@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
|
43
|
+
|
44
|
+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
45
|
+
|
46
|
+
## Enforcement Guidelines
|
47
|
+
|
48
|
+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
49
|
+
|
50
|
+
### 1. Correction
|
51
|
+
|
52
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
53
|
+
|
54
|
+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
55
|
+
|
56
|
+
### 2. Warning
|
57
|
+
|
58
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
59
|
+
|
60
|
+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
61
|
+
|
62
|
+
### 3. Temporary Ban
|
63
|
+
|
64
|
+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
65
|
+
|
66
|
+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
67
|
+
|
68
|
+
### 4. Permanent Ban
|
69
|
+
|
70
|
+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
71
|
+
|
72
|
+
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
73
|
+
|
74
|
+
## Attribution
|
75
|
+
|
76
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
|
77
|
+
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
78
|
+
|
79
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
80
|
+
|
81
|
+
[homepage]: https://www.contributor-covenant.org
|
82
|
+
|
83
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
84
|
+
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2023 Anthony L
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,205 @@
|
|
1
|
+
# PagePixels Screenshots
|
2
|
+
|
3
|
+
PagePixels is an API and web interface that provides automated screenshot capturing and change notifications for your web pages. With PagePixels, you can easily capature immediate screenshots, schedule recurring screenshots, set up change notifications, and use multi-step screenshotting functionality to complete forms, click links, and login to websites prior to taking screenshots.
|
4
|
+
|
5
|
+
## Getting Started
|
6
|
+
To use PagePixels, sign up for a free account and obtain your API key. No payment information is required. You can sign up and create an API key by visiting the PagePixels website https://pagepixels.com.
|
7
|
+
|
8
|
+
Once you have your API key, you can start making requests to the API.
|
9
|
+
|
10
|
+
## Installation
|
11
|
+
|
12
|
+
To install the `screenshots_pagepixels` gem, you can use the following command:
|
13
|
+
|
14
|
+
```
|
15
|
+
gem install screenshots_pagepixels
|
16
|
+
```
|
17
|
+
|
18
|
+
Alternatively, you can add the following line to your Gemfile:
|
19
|
+
|
20
|
+
```
|
21
|
+
gem 'screenshots_pagepixels'
|
22
|
+
```
|
23
|
+
|
24
|
+
And then run `bundle install` to install the gem.
|
25
|
+
|
26
|
+
Once the gem is installed, you can require it in your Ruby code:
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
require 'screenshots_pagepixels'
|
30
|
+
```
|
31
|
+
|
32
|
+
## Usage
|
33
|
+
The `PagePixelsScreenshots` RubyGem provides a simple and intuitive way to interface with the PagePixels API. The `PagePixelsScreenshots::Client` class provides the following methods.
|
34
|
+
|
35
|
+
Learn more about configuring your screenshots for your needs by here:
|
36
|
+
|
37
|
+
https://pagepixels.com/app/documentation#api-options
|
38
|
+
|
39
|
+
### `snap(options = {})`
|
40
|
+
Captures a screenshot of a web page immediately.
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
require 'screenshots_pagepixels'
|
44
|
+
|
45
|
+
client = PagePixelsScreenshots::Client.new('your-api-key')
|
46
|
+
options = { url: 'https://www.example.com' }
|
47
|
+
client.snap(options)
|
48
|
+
```
|
49
|
+
|
50
|
+
### `create_screenshot_config(options = {})`
|
51
|
+
Creates a new screenshot configuration, which can include a automatically recurring schedule, multi-step configurations, and more.
|
52
|
+
|
53
|
+
Learn more about multi-step (click links, complete forms, login to websites, etc) functionality here:
|
54
|
+
|
55
|
+
https://pagepixels.com/app/documentation#multi-step-screenshots
|
56
|
+
|
57
|
+
Learn more about configuring scheduled screenshots here:
|
58
|
+
|
59
|
+
https://pagepixels.com/app/documentation#scheduled-screenshots
|
60
|
+
|
61
|
+
```ruby
|
62
|
+
require 'screenshots_pagepixels'
|
63
|
+
|
64
|
+
client = PagePixelsScreenshots::Client.new('your-api-key')
|
65
|
+
options = { url: 'https://www.example.com', scheduled_screenshot: true, scheduled_every: 1, scheduled_interval: 'days' }
|
66
|
+
client.create_screenshot_config(options)
|
67
|
+
```
|
68
|
+
|
69
|
+
### `screenshot_configs(options = {})`
|
70
|
+
Allows you to retrieve your screenshot configurations.
|
71
|
+
|
72
|
+
```ruby
|
73
|
+
require 'screenshots_pagepixels'
|
74
|
+
|
75
|
+
client = PagePixelsScreenshots::Client.new('your-api-key')
|
76
|
+
client.screenshot_configs
|
77
|
+
```
|
78
|
+
|
79
|
+
### `get_screenshot_config(id)`
|
80
|
+
Gets a specific screenshot configuration.
|
81
|
+
|
82
|
+
```ruby
|
83
|
+
require 'screenshots_pagepixels'
|
84
|
+
|
85
|
+
client = PagePixelsScreenshots::Client.new('your-api-key')
|
86
|
+
client.get_screenshot_config('your-screenshot-config-id')
|
87
|
+
```
|
88
|
+
|
89
|
+
### `update_screenshot_config(id, options = {})`
|
90
|
+
Updates a specific screenshot configuration.
|
91
|
+
|
92
|
+
```ruby
|
93
|
+
require 'screenshots_pagepixels'
|
94
|
+
|
95
|
+
client = PagePixelsScreenshots::Client.new('your-api-key')
|
96
|
+
options = { scheduled_every: 2 }
|
97
|
+
client.update_screenshot_config('your-screenshot-config-id', options)
|
98
|
+
```
|
99
|
+
|
100
|
+
### `delete_screenshot_config(id)`
|
101
|
+
Deletes a specific screenshot configuration.
|
102
|
+
|
103
|
+
```ruby
|
104
|
+
require 'screenshots_pagepixels'
|
105
|
+
|
106
|
+
client = PagePixelsScreenshots::Client.new('your-api-key')
|
107
|
+
client.delete_screenshot_config('your-screenshot-config-id')
|
108
|
+
```
|
109
|
+
|
110
|
+
### `screenshot_config_screenshots(id, options = {})`
|
111
|
+
Retrieves a list of screenshots that were taken with a specific screenshot configuration.
|
112
|
+
|
113
|
+
```ruby
|
114
|
+
require 'screenshots_pagepixels'
|
115
|
+
|
116
|
+
client = PagePixelsScreenshots::Client.new('your-api-key')
|
117
|
+
client.screenshot_config_screenshots('your-screenshot-config-id')
|
118
|
+
```
|
119
|
+
|
120
|
+
### `screenshot_config_change_notifications(id, options = {})`
|
121
|
+
Provides an array of all Change Notifications for a specific screenshot configuration.
|
122
|
+
|
123
|
+
Learn more about configuring change notifications for your screenshots here:
|
124
|
+
|
125
|
+
https://pagepixels.com/app/documentation#screenshot-change-notifications
|
126
|
+
|
127
|
+
```ruby
|
128
|
+
require 'screenshots_pagepixels'
|
129
|
+
|
130
|
+
client = PagePixelsScreenshots::Client.new('your-api-key')
|
131
|
+
client.screenshot_config_change_notifications('your-screenshot-config-id')
|
132
|
+
```
|
133
|
+
|
134
|
+
### `job_status(job_id)`
|
135
|
+
Retrieves the status of a specific screenshot job associated with a screenshot configuration.
|
136
|
+
|
137
|
+
```ruby
|
138
|
+
require 'screenshots_pagepixels'
|
139
|
+
|
140
|
+
client = PagePixelsScreenshots::Client.new('your-api-key')
|
141
|
+
client.job_status('your-job-id')
|
142
|
+
```
|
143
|
+
|
144
|
+
### `capture_screenshot(id)`
|
145
|
+
Immediately captures a screenshot using a specific screenshot configuration. This bypasses all scheduling to take a screenshot immediately.
|
146
|
+
|
147
|
+
```ruby
|
148
|
+
require 'screenshots_pagepixels'
|
149
|
+
|
150
|
+
client = PagePixelsScreenshots::Client.new('your-api-key')
|
151
|
+
client.capture_screenshot('your-screenshot-config-id')
|
152
|
+
```
|
153
|
+
|
154
|
+
### `screenshots(options = {})`
|
155
|
+
Retrieves a list of all screenshots taken with your PagePixels account.
|
156
|
+
|
157
|
+
```ruby
|
158
|
+
require 'screenshots_pagepixels'
|
159
|
+
|
160
|
+
client = PagePixelsScreenshots::Client.new('your-api-key')
|
161
|
+
client.screenshots
|
162
|
+
```
|
163
|
+
|
164
|
+
### `change_notifications(options = {})`
|
165
|
+
Provides an array of all Change Notifications for all screenshot configurations.
|
166
|
+
|
167
|
+
```ruby
|
168
|
+
require 'screenshots_pagepixels'
|
169
|
+
|
170
|
+
client = PagePixelsScreenshots::Client.new('your-api-key')
|
171
|
+
client.change_notifications
|
172
|
+
```
|
173
|
+
|
174
|
+
# Some additional helpful information.
|
175
|
+
|
176
|
+
## Scheduling
|
177
|
+
With PagePixels, you can schedule recurring screenshots of your web pages. You can schedule screenshots through the user interface as well if needed.
|
178
|
+
|
179
|
+
The following options are available for scheduling:
|
180
|
+
|
181
|
+
| Option | Expected Value |
|
182
|
+
| --------------------| ----------------------|
|
183
|
+
| scheduled_screenshot | true or false |
|
184
|
+
| scheduled_every | Integer greater than 1|
|
185
|
+
| scheduled_interval | Any of: minutes, hours, days, weeks, months, years |
|
186
|
+
|
187
|
+
## Multi-Step Screenshots
|
188
|
+
PagePixels also provides the ability to use multi-step functionality to complete forms, navigate to different pages, click links and buttons, and login to your favorite websites prior to taking your screenshot.
|
189
|
+
|
190
|
+
The following actions are available for use with the multi-step functionality:
|
191
|
+
|
192
|
+
| Action | Example |
|
193
|
+
| ------------------------| -------------------------------------------------------------------|
|
194
|
+
| Click | {"type": "click", "selector": "#your-selector"} |
|
195
|
+
| Hover | {"type": "hover", "selector": "#your-selector"} |
|
196
|
+
| Change Notification | {"type": "change", "selector": "#your-selector", "send_to": "webhook", url: "https://example.com/webhook-url"} |
|
197
|
+
| Goto URL | {"type": "redirect", "value": "https://example.com"} |
|
198
|
+
| Run Javascript | {"type": "javascript", "value": "console.log('my javascript');"} |
|
199
|
+
| Insert CSS | {"type": "css", "value": "#selector{ color: red }"} |
|
200
|
+
| Text Field Input | {"type": "text_field", "selector": "#the-text-field", "value": "your-value"} |
|
201
|
+
| Dropdown Field Selection | {"type": "select", "selector": "#the-dropdown-field", "value": "selected value"} |
|
202
|
+
| Checkbox Field Input | {"type": "checkbox", "selector": "#the-checkbox-field", "value":true} |
|
203
|
+
| Press Enter | (to submit hidden forms) {"type": "submit"} |
|
204
|
+
| Wait X milliseconds | {"type": "wait", "value": "5000"} |
|
205
|
+
| Wait for Selector | {"type": "wait_for_selector", "selector": "#your-selector"} |
|
data/Rakefile
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
module ScreenshotsPagepixels
|
2
|
+
class Client
|
3
|
+
include HTTParty
|
4
|
+
base_uri 'https://api.pagepixels.com'
|
5
|
+
|
6
|
+
def initialize(bearer_token)
|
7
|
+
@bearer_token = bearer_token
|
8
|
+
end
|
9
|
+
|
10
|
+
def snap(options = {})
|
11
|
+
get_request('/snap', options)
|
12
|
+
rescue StandardError => e
|
13
|
+
handle_exception(e)
|
14
|
+
end
|
15
|
+
|
16
|
+
def screenshot_configs(options = {})
|
17
|
+
get_request('/screenshot_configs', options)
|
18
|
+
rescue StandardError => e
|
19
|
+
handle_exception(e)
|
20
|
+
end
|
21
|
+
|
22
|
+
def create_screenshot_config(options = {})
|
23
|
+
post_request('/screenshot_configs', options)
|
24
|
+
rescue StandardError => e
|
25
|
+
handle_exception(e)
|
26
|
+
end
|
27
|
+
|
28
|
+
def get_screenshot_config(id)
|
29
|
+
get_request("/screenshot_configs/#{id}")
|
30
|
+
rescue StandardError => e
|
31
|
+
handle_exception(e)
|
32
|
+
end
|
33
|
+
|
34
|
+
def update_screenshot_config(id, options = {})
|
35
|
+
patch_request("/screenshot_configs/#{id}", options)
|
36
|
+
rescue StandardError => e
|
37
|
+
handle_exception(e)
|
38
|
+
end
|
39
|
+
|
40
|
+
def delete_screenshot_config(id)
|
41
|
+
delete_request("/screenshot_configs/#{id}")
|
42
|
+
rescue StandardError => e
|
43
|
+
handle_exception(e)
|
44
|
+
end
|
45
|
+
|
46
|
+
def screenshot_config_screenshots(id, options = {})
|
47
|
+
get_request("/screenshot_configs/#{id}/screenshots", options)
|
48
|
+
rescue StandardError => e
|
49
|
+
handle_exception(e)
|
50
|
+
end
|
51
|
+
|
52
|
+
def screenshot_config_change_notifications(id, options = {})
|
53
|
+
get_request("/screenshot_configs/#{id}/change_notifications", options)
|
54
|
+
rescue StandardError => e
|
55
|
+
handle_exception(e)
|
56
|
+
end
|
57
|
+
|
58
|
+
def job_status(job_id)
|
59
|
+
get_request("/jobs/#{job_id}")
|
60
|
+
rescue StandardError => e
|
61
|
+
handle_exception(e)
|
62
|
+
end
|
63
|
+
|
64
|
+
def capture_screenshot(id)
|
65
|
+
post_request("/screenshot_configs/#{id}/capture")
|
66
|
+
rescue StandardError => e
|
67
|
+
handle_exception(e)
|
68
|
+
end
|
69
|
+
|
70
|
+
def screenshots(options = {})
|
71
|
+
get_request('/screenshots', options)
|
72
|
+
rescue StandardError => e
|
73
|
+
handle_exception(e)
|
74
|
+
end
|
75
|
+
|
76
|
+
def change_notifications(options = {})
|
77
|
+
get_request('/change_notifications', options)
|
78
|
+
rescue StandardError => e
|
79
|
+
handle_exception(e)
|
80
|
+
end
|
81
|
+
|
82
|
+
private
|
83
|
+
|
84
|
+
def get_request(path, options = {})
|
85
|
+
headers = { 'Authorization' => "Bearer #{@bearer_token}" }
|
86
|
+
response = self.class.get(path, query: options, headers: headers)
|
87
|
+
if path == "/snap" && !options[:json]
|
88
|
+
return response.body
|
89
|
+
else
|
90
|
+
JSON.parse(response.body)
|
91
|
+
end
|
92
|
+
rescue StandardError => e
|
93
|
+
handle_exception(e)
|
94
|
+
end
|
95
|
+
|
96
|
+
def post_request(path, options = {})
|
97
|
+
headers = { 'Authorization' => "Bearer #{@bearer_token}", 'Content-Type' => 'application/json' }
|
98
|
+
response = self.class.post(path, body: options.to_json, headers: headers)
|
99
|
+
JSON.parse(response.body)
|
100
|
+
rescue StandardError => e
|
101
|
+
handle_exception(e)
|
102
|
+
end
|
103
|
+
|
104
|
+
def patch_request(path, options = {})
|
105
|
+
headers = { 'Authorization' => "Bearer #{@bearer_token}", 'Content-Type' => 'application/json' }
|
106
|
+
response = self.class.patch(path, body: options.to_json, headers: headers)
|
107
|
+
JSON.parse(response.body)
|
108
|
+
rescue StandardError => e
|
109
|
+
handle_exception(e)
|
110
|
+
end
|
111
|
+
|
112
|
+
def delete_request(path)
|
113
|
+
headers = { 'Authorization' => "Bearer #{@bearer_token}" }
|
114
|
+
response = self.class.delete(path, headers: headers)
|
115
|
+
JSON.parse(response.body)
|
116
|
+
rescue StandardError => e
|
117
|
+
handle_exception(e)
|
118
|
+
end
|
119
|
+
|
120
|
+
def handle_exception(exception)
|
121
|
+
puts "An error occurred: #{exception.message}"
|
122
|
+
raise exception
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/screenshots_pagepixels/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "screenshots_pagepixels"
|
7
|
+
spec.version = ScreenshotsPagepixels::VERSION
|
8
|
+
spec.authors = ["PagePixels LLC"]
|
9
|
+
spec.email = ["support@pagepixels.com"]
|
10
|
+
|
11
|
+
spec.summary = "A Ruby Gem for interacting with the PagePixels API for automated screenshot capturing, multi-step screenshots (login to web pages, click links, etc), and change notifications"
|
12
|
+
spec.description = "PagePixels Screenshots is a Ruby Gem that provides a simple and easy-to-use interface for working with the PagePixels API. With this gem, you can easily capture screenshots, manage screenshot configurations, create recurring screenshot schedules, setup multi-step screenshots, and more. PagePixels Screenshots provides convenient methods that wrap around the API endpoints, making it easy to get started and integrate with your application."
|
13
|
+
spec.homepage = "https://pagepixels.com"
|
14
|
+
spec.license = "MIT"
|
15
|
+
spec.required_ruby_version = ">= 2.6.0"
|
16
|
+
|
17
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
18
|
+
spec.metadata["source_code_uri"] = "https://github.com/PagePixels/screenshots_pagepixels-ruby"
|
19
|
+
spec.metadata["changelog_uri"] = "https://github.com/PagePixels/screenshots_pagepixels-ruby/CHANGELOG.md"
|
20
|
+
|
21
|
+
# Specify which files should be added to the gem when it is released.
|
22
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
23
|
+
spec.files = Dir.chdir(__dir__) do
|
24
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
25
|
+
puts f.inspect
|
26
|
+
(File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor]) || File.extname(f) == '.gem'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
puts spec.files.inspect
|
30
|
+
spec.bindir = "exe"
|
31
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
32
|
+
spec.require_paths = ["lib"]
|
33
|
+
|
34
|
+
# Uncomment to register a new dependency of your gem
|
35
|
+
spec.add_dependency 'httparty', '~> 0.18.1'
|
36
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
37
|
+
end
|
metadata
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: screenshots_pagepixels
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- PagePixels LLC
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-05-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: httparty
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.18.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.18.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.0'
|
41
|
+
description: PagePixels Screenshots is a Ruby Gem that provides a simple and easy-to-use
|
42
|
+
interface for working with the PagePixels API. With this gem, you can easily capture
|
43
|
+
screenshots, manage screenshot configurations, create recurring screenshot schedules,
|
44
|
+
setup multi-step screenshots, and more. PagePixels Screenshots provides convenient
|
45
|
+
methods that wrap around the API endpoints, making it easy to get started and integrate
|
46
|
+
with your application.
|
47
|
+
email:
|
48
|
+
- support@pagepixels.com
|
49
|
+
executables: []
|
50
|
+
extensions: []
|
51
|
+
extra_rdoc_files: []
|
52
|
+
files:
|
53
|
+
- CHANGELOG.md
|
54
|
+
- CODE_OF_CONDUCT.md
|
55
|
+
- Gemfile
|
56
|
+
- LICENSE.txt
|
57
|
+
- README.md
|
58
|
+
- Rakefile
|
59
|
+
- lib/screenshots_pagepixels.rb
|
60
|
+
- lib/screenshots_pagepixels/client.rb
|
61
|
+
- lib/screenshots_pagepixels/version.rb
|
62
|
+
- screenshots_pagepixels.gemspec
|
63
|
+
- sig/screenshots_pagepixels.rbs
|
64
|
+
homepage: https://pagepixels.com
|
65
|
+
licenses:
|
66
|
+
- MIT
|
67
|
+
metadata:
|
68
|
+
homepage_uri: https://pagepixels.com
|
69
|
+
source_code_uri: https://github.com/PagePixels/screenshots_pagepixels-ruby
|
70
|
+
changelog_uri: https://github.com/PagePixels/screenshots_pagepixels-ruby/CHANGELOG.md
|
71
|
+
post_install_message:
|
72
|
+
rdoc_options: []
|
73
|
+
require_paths:
|
74
|
+
- lib
|
75
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: 2.6.0
|
80
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '0'
|
85
|
+
requirements: []
|
86
|
+
rubygems_version: 3.0.8
|
87
|
+
signing_key:
|
88
|
+
specification_version: 4
|
89
|
+
summary: A Ruby Gem for interacting with the PagePixels API for automated screenshot
|
90
|
+
capturing, multi-step screenshots (login to web pages, click links, etc), and change
|
91
|
+
notifications
|
92
|
+
test_files: []
|