outscraper 0.3.2 → 0.3.4
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/examples/Contacts And Leads.md +32 -0
- data/examples/Google Directions.md +32 -0
- data/lib/outscraper/version.rb +1 -1
- data/lib/outscraper.rb +42 -3
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e490638335315130985cc5b8f5c2c268b72a56142fb4c06383dabff1ecfd3ece
|
|
4
|
+
data.tar.gz: 2ef885848538c535630b6ded859f0fa8657fd36455e45fe07a7da93bc5180ad9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 732b1c087ccf83a52193fe54afaf03a0fa31d642dfab11c03c587a04b427df9df2962e0b259690e7e49c3a2de77d36901fc89f9e60953d17aadd836300609780
|
|
7
|
+
data.tar.gz: 8a8c95af2d738edc5aba671ee0f1005302c6674a81ca5c7c9830c4f8f6b0b4cc53823da594af1df51e6da175b3d81d798ab779c4dc1aa6cb65ea382910e0b779
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Emails And Contacts Scraper With Python
|
|
2
|
+
|
|
3
|
+
Allows finding email addresses, social links, and phones from domains via [Outscraper API](https://app.outscraper.cloud/api-docs#tag/Email-Related/paths/~1contacts-and-leads/get).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Install the gem and add to the application's Gemfile by executing:
|
|
8
|
+
```bash
|
|
9
|
+
bundle add outscraper
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
|
13
|
+
```bash
|
|
14
|
+
gem install outscraper
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
[Link to the Ruby package page](https://rubygems.org/gems/outscraper)
|
|
18
|
+
|
|
19
|
+
## Initialization
|
|
20
|
+
```ruby
|
|
21
|
+
require 'Outscraper'
|
|
22
|
+
|
|
23
|
+
client = Outscraper::Client.new('SECRET_API_KEY')
|
|
24
|
+
```
|
|
25
|
+
[Link to the profile page to create the API key](https://app.outscraper.com/profile)
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
```ruby
|
|
30
|
+
# Search contacts from a website:
|
|
31
|
+
results = client.contacts_and_leads('outscraper.com')
|
|
32
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Emails And Contacts Scraper With Ruby
|
|
2
|
+
|
|
3
|
+
Returns directions between two points from Google Maps. [Outscraper API](https://app.outscraper.cloud/api-docs#tag/Google/paths/~1maps~1directions/get).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Install the gem and add to the application's Gemfile by executing:
|
|
8
|
+
```bash
|
|
9
|
+
bundle add outscraper
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
|
13
|
+
```bash
|
|
14
|
+
gem install outscraper
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
[Link to the Ruby package page](https://rubygems.org/gems/outscraper)
|
|
18
|
+
|
|
19
|
+
## Initialization
|
|
20
|
+
```ruby
|
|
21
|
+
require 'Outscraper'
|
|
22
|
+
|
|
23
|
+
client = Outscraper::Client.new('SECRET_API_KEY')
|
|
24
|
+
```
|
|
25
|
+
[Link to the profile page to create the API key](https://app.outscraper.com/profile)
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
```ruby
|
|
30
|
+
# Returns directions:
|
|
31
|
+
results = client.google_maps_directions(['29.696596, 76.994928 30.7159662444353, 76.8053887016268', '29.696596, 76.994928 30.723065, 76.770169'])
|
|
32
|
+
```
|
data/lib/outscraper/version.rb
CHANGED
data/lib/outscraper.rb
CHANGED
|
@@ -4,6 +4,19 @@ require "httparty"
|
|
|
4
4
|
|
|
5
5
|
require_relative "outscraper/version"
|
|
6
6
|
|
|
7
|
+
QUERY_DELIMITER = ' '
|
|
8
|
+
|
|
9
|
+
def format_direction_queries(q)
|
|
10
|
+
if q.is_a?(Array) && !q.empty? && q.first.is_a?(Array)
|
|
11
|
+
return q.map { |pair| pair.join(QUERY_DELIMITER) }
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
return q if q.is_a?(Array)
|
|
15
|
+
|
|
16
|
+
[q]
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
|
|
7
20
|
module Outscraper
|
|
8
21
|
class Client
|
|
9
22
|
include HTTParty
|
|
@@ -61,10 +74,10 @@ module Outscraper
|
|
|
61
74
|
}).parsed_response['data']
|
|
62
75
|
end
|
|
63
76
|
|
|
64
|
-
def google_maps_directions(
|
|
77
|
+
def google_maps_directions(query:, departure_time: nil, finish_time: nil, interval: nil, travel_mode: 'best', language: 'en', region: nil, fields: nil, async_request: true)
|
|
78
|
+
queries = format_direction_queries(query)
|
|
65
79
|
response = self.class.get('/maps/directions', query: {
|
|
66
|
-
|
|
67
|
-
destination: Array(destination),
|
|
80
|
+
query: queries,
|
|
68
81
|
departure_time: departure_time,
|
|
69
82
|
finish_time: finish_time,
|
|
70
83
|
interval: interval,
|
|
@@ -122,6 +135,32 @@ module Outscraper
|
|
|
122
135
|
}).parsed_response['data']
|
|
123
136
|
end
|
|
124
137
|
|
|
138
|
+
def contacts_and_leads(
|
|
139
|
+
query,
|
|
140
|
+
fields: nil,
|
|
141
|
+
async_request: true,
|
|
142
|
+
preferred_contacts: nil,
|
|
143
|
+
contacts_per_company: 3,
|
|
144
|
+
emails_per_contact: 1,
|
|
145
|
+
skip_contacts: 0,
|
|
146
|
+
general_emails: false,
|
|
147
|
+
ui: false,
|
|
148
|
+
webhook: nil
|
|
149
|
+
)
|
|
150
|
+
response = self.class.get('/contacts-and-leads', query: {
|
|
151
|
+
query: query,
|
|
152
|
+
fields: fields ? Array(fields) : nil,
|
|
153
|
+
async: ui ? true : async_request,
|
|
154
|
+
preferred_contacts: preferred_contacts ? Array(preferred_contacts) : nil,
|
|
155
|
+
contacts_per_company: contacts_per_company,
|
|
156
|
+
emails_per_contact: emails_per_contact,
|
|
157
|
+
skip_contacts: skip_contacts,
|
|
158
|
+
general_emails: general_emails,
|
|
159
|
+
ui: ui,
|
|
160
|
+
webhook: webhook
|
|
161
|
+
}).parsed_response['data']
|
|
162
|
+
end
|
|
163
|
+
|
|
125
164
|
def emails_and_contacts(query)
|
|
126
165
|
response = self.class.get("/emails-and-contacts", 'query': {
|
|
127
166
|
query: query,
|
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.3.
|
|
4
|
+
version: 0.3.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Outscraper
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-12-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: httparty
|
|
@@ -41,8 +41,10 @@ files:
|
|
|
41
41
|
- Rakefile
|
|
42
42
|
- examples/Company Insights.md
|
|
43
43
|
- examples/Company Website Finder.md
|
|
44
|
+
- examples/Contacts And Leads.md
|
|
44
45
|
- examples/Email Addresses Finder.md
|
|
45
46
|
- examples/Emails And Contacts.md
|
|
47
|
+
- examples/Google Directions.md
|
|
46
48
|
- examples/Google Maps Photos Scraper.md
|
|
47
49
|
- examples/Google Maps Reviews.md
|
|
48
50
|
- examples/Google Maps.md
|