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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b4ceb44c4640ab93268a449b90b3c2cb5ee2c4ee11bf0035b1661765662d104
4
- data.tar.gz: cad932294af50b9a90d88f3c6008645346e77f0814844d92b6911a7964d6c308
3
+ metadata.gz: ae0b4ed4d0f63eecef44c12169f11f2db4ddfe394a4ce91fda943d0990d9c617
4
+ data.tar.gz: 3973224543e9cb45a885eec70e3a2c70d89374392b6e94d61ebc42f5b4385936
5
5
  SHA512:
6
- metadata.gz: 13270e660b4bb3b69265147a65c07bac5eb3ce03410e8fc260cb246631c703f98b6c261aabf547e81f7b8bebae0c0f4929cc0e085602ad4282c4aac637075176
7
- data.tar.gz: 8d3d862efcafef5a430abad6f2da6b8fa01054951c0fbf11858b1de11a140773f0acf7359e20ae3459b2de85741f992668fbe1d35b7eb7cb8b5b3b2fc089245e
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
- job_type: "fetch",
99
- payload: { url: "https://example.com", output: ["markdown"] }
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
- def get_reviews(property_id: nil, url: nil, page: nil, language: nil)
30
- @http.get("/v1/agoda/reviews", { property_id: property_id, url: url, page: page, language: language })
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(query, country: nil, page: nil)
11
- @http.get("/v1/amazon/search", { query: query, country: country, page: page })
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, actions: nil, timeout: nil, proxy: nil, country: 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, actions: actions,
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(job_type:, payload:, webhook_url: nil)
9
- @http.post("/v1/jobs", { job_type: job_type, payload: payload, webhook_url: webhook_url })
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, country: nil)
12
- @http.get("/v1/walmart/product", { product_id: product_id, country: country })
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(query, country: nil, page: nil)
16
- @http.get("/v1/walmart/search", { query: query, country: country, page: page })
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(query, page: nil, country: nil, language: nil)
11
- @http.get("/v1/youtube/search", { query: query, page: page, country: country, language: language })
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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scrapio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scrapio