outscraper 0.1.3 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c1dd2b61df018c2b7b9f46537e9e088f42cc75d1c9eb1d756966303686062245
4
- data.tar.gz: a3e1423a8a94e84de918702b5d112051552cad84b121d6d30205fa3572bade54
3
+ metadata.gz: ecd1b55729f33ebcce279af3365a4418c44fc070f00c322a7c95c343216cfa2f
4
+ data.tar.gz: 98808bea598828ff72b51abf5e05eb008ce51cba8f9e6f773a5d93f7b90edffd
5
5
  SHA512:
6
- metadata.gz: 52d84300f735a8f0e0dd0b2f42a680bfd129958f624dc374ffa2a8fe1784ff743cfe1f3bf5aec5f1010a1f2065b122640f2128646d3b6be1ae66050753cd1fde
7
- data.tar.gz: 0be887cd6b95716c55501ffa7083ed45bed2ab10792f6f93ffc92acda3ae7ee73e48aefda1bd529d9ed21c00cbb60b3f8a8bf6332d64cfc22b1cafdea2c3fbb3
6
+ metadata.gz: c73198998dc45e0161b84f0bab6e0e1c5ff5b54dc255c0c61d6a720c5f4449bf5a44a36ed2eb763da400c90b6e3046eb9a2390335e2013776dbfaeba1bd73bd5
7
+ data.tar.gz: 68e5203217a94f9ab6ae6964f569a7a75909d68787b44c13388c28b120fca8b3aec518a6cd0a995efd0651f186b3a2f59339242c837b1b5e59ec921350d36fc3
data/CHANGELOG.md CHANGED
@@ -3,3 +3,7 @@
3
3
  ## [0.1.0] - 2022-07-16
4
4
 
5
5
  - Initial release
6
+
7
+ ## [1.0.0] - 2022-07-16
8
+
9
+ - Use the latest versions by default
data/README.md CHANGED
@@ -28,16 +28,16 @@ client = Outscraper::Client.new('SECRET_API_KEY')
28
28
 
29
29
  ```ruby
30
30
  # Search for businesses in specific locations:
31
- result = client.google_maps_search_v2('restaurants brooklyn usa', limit: 20, language: 'en', region: 'us')
31
+ results = client.google_maps_search('restaurants brooklyn usa', limit: 20, language: 'en', region: 'us')
32
32
 
33
33
  # Get data of the specific place by id
34
- result = client.google_maps_search_v2('ChIJrc9T9fpYwokRdvjYRHT8nI4', language: 'en')
34
+ results = client.google_maps_search('ChIJrc9T9fpYwokRdvjYRHT8nI4', language: 'en')
35
35
 
36
36
  # Get reviews of the specific place by id
37
- result = client.google_maps_reviews_v3('ChIJrc9T9fpYwokRdvjYRHT8nI4', reviews_limit: 20, language: 'en')
37
+ results = client.google_maps_reviews('ChIJrc9T9fpYwokRdvjYRHT8nI4', reviews_limit: 20, language: 'en')
38
38
 
39
39
  # Search contacts from website
40
- result = client.emails_and_contacts('outscraper.com')
40
+ results = client.emails_and_contacts('outscraper.com')
41
41
  ```
42
42
 
43
43
  [More examples](https://github.com/outscraper/outscraper-ruby/tree/master/examples)
@@ -49,5 +49,4 @@ After checking out the repo, run `bin/setup` to install dependencies. You can al
49
49
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
50
50
 
51
51
  ## Contributing
52
-
53
- Bug reports and pull requests are welcome on GitHub at https://github.com/outscraper/outscraper-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/outscraper/outscraper-ruby/blob/master/CODE_OF_CONDUCT.md).
52
+ Bug reports and pull requests are welcome on GitHub at https://github.com/outscraper/outscraper-ruby.
@@ -28,5 +28,5 @@ client = Outscraper::Client.new('SECRET_API_KEY')
28
28
 
29
29
  ```ruby
30
30
  # Search contacts from website:
31
- result = client.emails_and_contacts('outscraper.com')
31
+ results = client.emails_and_contacts('outscraper.com')
32
32
  ```
@@ -1,6 +1,11 @@
1
1
  # Google Maps Reviews Scraper With Ruby
2
2
 
3
3
  The library provides real-time access to the reviews from Google Maps via [Outscraper API](https://app.outscraper.com/api-docs#tag/Google-Reviews).
4
+ It allows scraping all the reviews from any place on Google Maps within seconds.
5
+
6
+ - Not limited to the official Google API limit of 5 reviews per a place
7
+ - Real time data scraping with response time less than 3s
8
+ - Sort, skip, ignore, cutoff, and other advanced parameters
4
9
 
5
10
  ## Installation
6
11
 
@@ -28,14 +33,14 @@ client = Outscraper::Client.new('SECRET_API_KEY')
28
33
 
29
34
  ```ruby
30
35
  # Get reviews of the specific place by id
31
- result = client.google_maps_reviews_v3('ChIJrc9T9fpYwokRdvjYRHT8nI4', reviews_limit: 20, language: 'en')
36
+ results = client.google_maps_reviews('ChIJrc9T9fpYwokRdvjYRHT8nI4', reviews_limit: 20, language: 'en')
32
37
 
33
38
  # Get reviews for places found by search query
34
- result = client.google_maps_reviews_v3('Memphis Seoul brooklyn usa', reviews_limit: 20, limit: 500, language: 'en')
39
+ results = client.google_maps_reviews('Memphis Seoul brooklyn usa', reviews_limit: 20, limit: 500, language: 'en')
35
40
 
36
41
  # Get only new reviews during last 24 hours
37
42
  yesterday_timestamp = 1657980986
38
43
 
39
- result = client.google_maps_reviews_v3(
44
+ results = client.google_maps_reviews(
40
45
  'ChIJrc9T9fpYwokRdvjYRHT8nI4', sort: 'newest', cutoff: yesterday_timestamp, reviews_limit: 100, language: 'en')
41
46
  ```
@@ -1,6 +1,7 @@
1
1
  # Google Maps Scraper With Ruby
2
2
 
3
3
  The library provides real-time access to the places from Google Maps via [Outscraper API](https://app.outscraper.com/api-docs#tag/Google-Maps).
4
+ It allows easy scraping of [businesses information](https://outscraper.com/google-maps-scraper/#dictionary) from Google Maps.
4
5
 
5
6
  ## Installation
6
7
 
@@ -28,8 +29,8 @@ client = Outscraper::Client.new('SECRET_API_KEY')
28
29
 
29
30
  ```ruby
30
31
  # Search for businesses in specific locations:
31
- result = client.google_maps_search_v2('restaurants brooklyn usa', limit: 20, language: 'en', region: 'us')
32
+ results = client.google_maps_search('restaurants brooklyn usa', limit: 20, language: 'en', region: 'us')
32
33
 
33
34
  # Get data of the specific place by id
34
- result = client.google_maps_search_v2('ChIJrc9T9fpYwokRdvjYRHT8nI4', language: 'en')
35
+ results = client.google_maps_search('ChIJrc9T9fpYwokRdvjYRHT8nI4', language: 'en')
35
36
  ```
@@ -28,5 +28,5 @@ client = Outscraper::Client.new('SECRET_API_KEY')
28
28
 
29
29
  ```ruby
30
30
  # Search for SERP results:
31
- result = client.google_search('buy iphone 13 TX', language: 'en', region: 'us')
31
+ results = client.google_search('buy iphone 13 TX', language: 'en', region: 'us')
32
32
  ```
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Outscraper
4
- VERSION = "0.1.3"
4
+ VERSION = "0.2.0"
5
5
  end
data/lib/outscraper.rb CHANGED
@@ -10,11 +10,11 @@ module Outscraper
10
10
  base_uri 'https://api.app.outscraper.com'
11
11
 
12
12
  def initialize(api_key)
13
- self.class.headers 'X-API-KEY' => api_key
13
+ self.class.headers 'X-API-KEY' => api_key, 'Accept-Encoding' => 'utf-8'
14
14
  end
15
15
 
16
16
  def google_search(query, pages_per_query: 1, uule: '', language: 'en', region: nil)
17
- response = self.class.get("/google-search-v2", 'query': {
17
+ response = self.class.get("/google-search-v3", 'query': {
18
18
  query: query,
19
19
  pagesPerQuery: pages_per_query,
20
20
  uule: uule,
@@ -24,7 +24,7 @@ module Outscraper
24
24
  }).parsed_response['data']
25
25
  end
26
26
 
27
- def google_maps_search_v2(query, limit: 20, drop_duplicates: false, language: 'en', region: nil, skip: 0)
27
+ def google_maps_search(query, limit: 20, drop_duplicates: false, language: 'en', region: nil, skip: 0)
28
28
  response = self.class.get("/maps/search-v2", 'query': {
29
29
  query: query,
30
30
  limit: limit,
@@ -36,7 +36,7 @@ module Outscraper
36
36
  }).parsed_response['data']
37
37
  end
38
38
 
39
- def google_maps_reviews_v3(query, reviews_limit: 10, limit: 1, sort: 'most_relevant', skip: 0, start: 0, cutoff: 0, cutoff_rating: 0, ignore_empty: false, language: 'en', region: nil, reviews_query: nil)
39
+ def google_maps_reviews(query, reviews_limit: 10, limit: 1, sort: 'most_relevant', skip: 0, start: 0, cutoff: 0, cutoff_rating: 0, ignore_empty: false, language: 'en', region: nil, reviews_query: nil)
40
40
  response = self.class.get("/maps/reviews-v3", 'query': {
41
41
  query: query,
42
42
  reviewsLimit: reviews_limit,
data/test.rb ADDED
@@ -0,0 +1,4 @@
1
+ require 'Outscraper'
2
+
3
+ client = Outscraper::Client.new('YXV0aDB8NjAyMDFmODYwOTQ5M2UwMDZhOGM4YjZhfDhkMjQ2NDQ1Nzc')
4
+ p client.google_search('buy iphone 13 TX', language: 'en', region: 'us')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: outscraper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Outscraper
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-16 00:00:00.000000000 Z
11
+ date: 2024-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -47,6 +47,7 @@ files:
47
47
  - lib/outscraper.rb
48
48
  - lib/outscraper/version.rb
49
49
  - sig/outscraper.rbs
50
+ - test.rb
50
51
  homepage: https://github.com/outscraper/outscraper-ruby
51
52
  licenses:
52
53
  - MIT
@@ -65,14 +66,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
65
66
  requirements:
66
67
  - - ">="
67
68
  - !ruby/object:Gem::Version
68
- version: 2.6.0
69
+ version: 2.7.0
69
70
  required_rubygems_version: !ruby/object:Gem::Requirement
70
71
  requirements:
71
72
  - - ">="
72
73
  - !ruby/object:Gem::Version
73
74
  version: '0'
74
75
  requirements: []
75
- rubygems_version: 3.0.3.1
76
+ rubygems_version: 3.1.6
76
77
  signing_key:
77
78
  specification_version: 4
78
79
  summary: Ruby bindings for the Outscraper API