scrapio 1.1.0 → 1.1.1
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/README.md +2 -2
- data/lib/scrapio/resources/agoda.rb +7 -2
- data/lib/scrapio/resources/amazon.rb +2 -2
- data/lib/scrapio/resources/fetch.rb +2 -3
- data/lib/scrapio/resources/jobs.rb +3 -2
- data/lib/scrapio/resources/walmart.rb +4 -4
- data/lib/scrapio/resources/youtube.rb +5 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ae0b4ed4d0f63eecef44c12169f11f2db4ddfe394a4ce91fda943d0990d9c617
|
|
4
|
+
data.tar.gz: 3973224543e9cb45a885eec70e3a2c70d89374392b6e94d61ebc42f5b4385936
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 36f05244c3a9662a9e0e99a3af16bf1c60bca4e351d1473a6bbbc3a860a118a61ad837e4cf13889a3d364db7ccd2444ae5e2e15a87fd291bd32f36162d445b0b
|
|
7
|
+
data.tar.gz: 7ef9b4738e632c0512c40b92f6df3fb1d06bc325213d7142102cfd95816c0e1a408aa609db8af2d7b9b1ef2b72b384a739865cc589734ae31349bad9a3322048
|
data/README.md
CHANGED
|
@@ -95,8 +95,8 @@ puts result["result"]["summary"]["pages_succeeded"]
|
|
|
95
95
|
|
|
96
96
|
```ruby
|
|
97
97
|
job = client.jobs.create(
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
kind: "fetch",
|
|
99
|
+
input: { url: "https://example.com", output: ["markdown"] }
|
|
100
100
|
)
|
|
101
101
|
|
|
102
102
|
result = client.jobs.wait_for_completion(job["job_id"])
|
|
@@ -26,8 +26,13 @@ module Scrapio
|
|
|
26
26
|
})
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
# Provide url, or property_id together with city_id (from a prior
|
|
30
|
+
# search's resolved_city_id).
|
|
31
|
+
def get_reviews(property_id: nil, city_id: nil, url: nil, page: nil, sort_by: nil, language: nil)
|
|
32
|
+
@http.get("/v1/agoda/reviews", {
|
|
33
|
+
property_id: property_id, city_id: city_id, url: url,
|
|
34
|
+
page: page, sort_by: sort_by, language: language,
|
|
35
|
+
})
|
|
31
36
|
end
|
|
32
37
|
end
|
|
33
38
|
end
|
|
@@ -7,8 +7,8 @@ module Scrapio
|
|
|
7
7
|
@http.get("/v1/amazon/product", { asin: asin, country: country })
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
-
def search(
|
|
11
|
-
@http.get("/v1/amazon/search", {
|
|
10
|
+
def search(search, country: nil, page: nil)
|
|
11
|
+
@http.get("/v1/amazon/search", { search: search, country: country, page: page })
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
end
|
|
@@ -4,11 +4,10 @@ module Scrapio
|
|
|
4
4
|
def initialize(http) = @http = http
|
|
5
5
|
|
|
6
6
|
def fetch(url:, render_js: nil, device: nil, session: nil, output: nil,
|
|
7
|
-
extract: nil,
|
|
7
|
+
extract: nil, wait_for: nil, timeout_ms: nil)
|
|
8
8
|
@http.post("/v1/fetch", {
|
|
9
9
|
url: url, render_js: render_js, device: device, session: session,
|
|
10
|
-
output: output, extract: extract,
|
|
11
|
-
timeout: timeout, proxy: proxy, country: country,
|
|
10
|
+
output: output, extract: extract, wait_for: wait_for, timeout_ms: timeout_ms,
|
|
12
11
|
})
|
|
13
12
|
end
|
|
14
13
|
end
|
|
@@ -5,8 +5,9 @@ module Scrapio
|
|
|
5
5
|
|
|
6
6
|
def initialize(http) = @http = http
|
|
7
7
|
|
|
8
|
-
def create(
|
|
9
|
-
|
|
8
|
+
def create(kind:, input:, webhook_url: nil)
|
|
9
|
+
webhook = webhook_url.nil? ? nil : { url: webhook_url }
|
|
10
|
+
@http.post("/v1/jobs", { kind: kind, input: input, webhook: webhook })
|
|
10
11
|
end
|
|
11
12
|
|
|
12
13
|
def get(job_id)
|
|
@@ -8,12 +8,12 @@ module Scrapio
|
|
|
8
8
|
# individual Walmart product pages) and will 404 until it's
|
|
9
9
|
# re-enabled. `search` is unaffected. See
|
|
10
10
|
# specs/product/walmart-api.md in the main repo.
|
|
11
|
-
def get_product(product_id,
|
|
12
|
-
@http.get("/v1/walmart/product", { product_id: product_id,
|
|
11
|
+
def get_product(product_id, zip_code: nil)
|
|
12
|
+
@http.get("/v1/walmart/product", { product_id: product_id, zip_code: zip_code })
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
def search(
|
|
16
|
-
@http.get("/v1/walmart/search", {
|
|
15
|
+
def search(search, zip_code: nil, page: nil)
|
|
16
|
+
@http.get("/v1/walmart/search", { search: search, zip_code: zip_code, page: page })
|
|
17
17
|
end
|
|
18
18
|
end
|
|
19
19
|
end
|
|
@@ -7,8 +7,11 @@ module Scrapio
|
|
|
7
7
|
@http.get("/v1/youtube/videos/#{URI.encode_uri_component(video_id)}")
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
-
def search(
|
|
11
|
-
@http.get("/v1/youtube/search", {
|
|
10
|
+
def search(search, start_page: nil, end_page: nil, country: nil, language: nil)
|
|
11
|
+
@http.get("/v1/youtube/search", {
|
|
12
|
+
search: search, start_page: start_page, end_page: end_page,
|
|
13
|
+
country: country, language: language,
|
|
14
|
+
})
|
|
12
15
|
end
|
|
13
16
|
|
|
14
17
|
def get_subtitles(video_id, language: nil)
|