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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +5 -6
- data/examples/Emails And Contacts.md +1 -1
- data/examples/Google Maps Reviews.md +8 -3
- data/examples/Google Maps.md +3 -2
- data/examples/Google SERP.md +1 -1
- data/lib/outscraper/version.rb +1 -1
- data/lib/outscraper.rb +4 -4
- data/test.rb +4 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecd1b55729f33ebcce279af3365a4418c44fc070f00c322a7c95c343216cfa2f
|
4
|
+
data.tar.gz: 98808bea598828ff72b51abf5e05eb008ce51cba8f9e6f773a5d93f7b90edffd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c73198998dc45e0161b84f0bab6e0e1c5ff5b54dc255c0c61d6a720c5f4449bf5a44a36ed2eb763da400c90b6e3046eb9a2390335e2013776dbfaeba1bd73bd5
|
7
|
+
data.tar.gz: 68e5203217a94f9ab6ae6964f569a7a75909d68787b44c13388c28b120fca8b3aec518a6cd0a995efd0651f186b3a2f59339242c837b1b5e59ec921350d36fc3
|
data/CHANGELOG.md
CHANGED
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
|
-
|
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
|
-
|
34
|
+
results = client.google_maps_search('ChIJrc9T9fpYwokRdvjYRHT8nI4', language: 'en')
|
35
35
|
|
36
36
|
# Get reviews of the specific place by id
|
37
|
-
|
37
|
+
results = client.google_maps_reviews('ChIJrc9T9fpYwokRdvjYRHT8nI4', reviews_limit: 20, language: 'en')
|
38
38
|
|
39
39
|
# Search contacts from website
|
40
|
-
|
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.
|
@@ -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
|
-
|
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
|
-
|
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
|
-
|
44
|
+
results = client.google_maps_reviews(
|
40
45
|
'ChIJrc9T9fpYwokRdvjYRHT8nI4', sort: 'newest', cutoff: yesterday_timestamp, reviews_limit: 100, language: 'en')
|
41
46
|
```
|
data/examples/Google Maps.md
CHANGED
@@ -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
|
-
|
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
|
-
|
35
|
+
results = client.google_maps_search('ChIJrc9T9fpYwokRdvjYRHT8nI4', language: 'en')
|
35
36
|
```
|
data/examples/Google SERP.md
CHANGED
@@ -28,5 +28,5 @@ client = Outscraper::Client.new('SECRET_API_KEY')
|
|
28
28
|
|
29
29
|
```ruby
|
30
30
|
# Search for SERP results:
|
31
|
-
|
31
|
+
results = client.google_search('buy iphone 13 TX', language: 'en', region: 'us')
|
32
32
|
```
|
data/lib/outscraper/version.rb
CHANGED
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-
|
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
|
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
|
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
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.
|
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:
|
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.
|
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.
|
76
|
+
rubygems_version: 3.1.6
|
76
77
|
signing_key:
|
77
78
|
specification_version: 4
|
78
79
|
summary: Ruby bindings for the Outscraper API
|