Finder.pm

filter: Statementstmt 52.4% 76 / 145 Branchbran 0.0% 0 / 16 Conditioncond 0.0% 0 / 12 MC/DCmcdc 0.0% 0 / 8 Subroutinesub 32.0% 25 / 78 Podpod 100% 53 / 53 totaltotal 49.3% 154 / 312 CC 13 SCAR 15.9
CC
13
Cov
44%
EmailFinder
20.0
Enrichment
20.0
AuthorFinder
20.0
CRAP 4.9
« Bulk.pm ↑ Summary Phone.pm »
1 package Tomba::Finder;
2  
3 4 ▶use 5.026001;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use parent 'Tomba::Client';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 # Import all service modules so their methods are available
9 4 ▶use Tomba::Account;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 4 ▶use Tomba::Domain;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 4 ▶use Tomba::Verifier;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 4 ▶use Tomba::Phone;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 4 ▶use Tomba::Count;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 4 ▶use Tomba::Status;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 4 ▶use Tomba::Sources;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 4 ▶use Tomba::Format;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 4 ▶use Tomba::Similar;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 4 ▶use Tomba::Technology;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 4 ▶use Tomba::Location;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 4 ▶use Tomba::Enrichment;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 4 ▶use Tomba::Reveal;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 4 ▶use Tomba::Keys;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 4 ▶use Tomba::Usage;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 4 ▶use Tomba::Logs;
Subroutine BEGIN: called CC=1 SCAR=0.0
25 4 ▶use Tomba::Flag;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 4 ▶use Tomba::Leads;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 4 ▶use Tomba::LeadsList;
Subroutine BEGIN: called CC=1 SCAR=0.0
28 4 ▶use Tomba::LeadsAttributes;
Subroutine BEGIN: called CC=1 SCAR=0.0
29 4 ▶use Tomba::Bulk;
Subroutine BEGIN: called CC=1 SCAR=0.0
30  
31 4 our $VERSION = '1.1.0';
32  
33 #-------------------------------------------------------------------------------
34  
35 =head1 NAME
36  
37 Tomba::Finder - Perl client library for the Tomba.io Email Finder API
38  
39 =head1 SYNOPSIS
40  
41 use Tomba::Finder;
42  
43 my $tomba = Tomba::Finder->new("ta_xxxxx", "ts_xxxxx");
44  
45 # Account info
46 my $account = $tomba->Account();
47  
48 # Domain search
49 my $results = $tomba->DomainSearch("tomba.io");
50  
51 # Email finder
52 my $email = $tomba->EmailFinder("asana.com", "Dustin", "Moskovitz");
53  
54 # Email verifier
55 my $verified = $tomba->EmailVerifier("b.mohamed@tomba.io");
56  
57 # Phone finder
58 my $phone = $tomba->PhoneFinder({ email => 'm@wordpress.org' });
59  
60 =head1 DESCRIPTION
61  
62 This is the official Perl client library for the L<Tomba.io|https://tomba.io> Email Finder API,
63 allowing you to:
64  
65 =over 4
66  
67 =item * L<Domain Search|https://tomba.io/domain-search> - Search emails based on a website domain.
68  
69 =item * L<Email Finder|https://tomba.io/email-finder> - Generate or retrieve the most likely email address from a domain name, first name and last name.
70  
71 =item * L<Author Finder|https://tomba.io/author-finder> - Instantly discover email addresses of article authors.
72  
73 =item * L<Enrichment|https://tomba.io/enrichment> - Find job title, company, location and social profiles from an email.
74  
75 =item * L<Linkedin Finder|https://tomba.io/linkedin-finder> - Find email addresses from LinkedIn URLs.
76  
77 =item * L<Email Verifier|https://tomba.io/email-verifier> - Check the deliverability of a given email address.
78  
79 =item * L<Phone Finder|https://tomba.io/phone-finder> - Find phone numbers associated with an email or domain.
80  
81 =item * L<Companies Search|https://docs.tomba.io/api/reveal#search-companies> - Search for companies using natural language or structured filters.
82  
83 =back
84  
85 See L<https://docs.tomba.io> for full API documentation.
86  
87 This module acts as a unified facade. Each API group is also available as a
88 standalone module (L<Tomba::Account>, L<Tomba::Domain>, L<Tomba::Verifier>,
89 etc.) that inherits from L<Tomba::Client>.
90  
91 =cut
92  
93 #-------------------------------------------------------------------------------
94 # Email Finder
95 #-------------------------------------------------------------------------------
96  
97 =head2 EmailFinder
98  
99 my $data = $tomba->EmailFinder("asana.com", "Dustin", "Moskovitz");
100  
101 Generates or retrieves the most likely email address from a domain name, a first name and a last name.
102  
103 See L<https://docs.tomba.io/api/finder#get-email-finder>
104  
105 =cut
106  
107 0 ▶sub EmailFinder {
Subroutine EmailFinder: not called CC=4 SCAR=30.0
Pod documented
108 0 my ($self, $domain, $first_name, $last_name, $opts) = @_;
109 0 my $params = {
110 domain => $domain,
111 first_name => $first_name,
112 last_name => $last_name,
113 };
114 0 ▶ if ($opts && ref($opts) eq 'HASH') {
Branch: 1 branch
BranchTrueFalseTotal
if ($opts and ref $opts eq "HASH") 0 0 0
Condition0%0/3
$opts and ref $opts eq "HASH"
!ll&&!rl&&r
000
MC/DC0%0/2
$opts and ref $opts eq "HASH"
$opts ref $opts eq "HASH"
Truth table0%0/3
A and B
A= $optsB= ref $opts eq "HASH"
ABresult
0X0
100
111
115 0 ▶ $params->{webhook_url} = $opts->{webhook_url} if exists $opts->{webhook_url};
Branch: 1 branch
BranchTrueFalseTotal
if exists $opts->{"webhook_url"} 0 0 0
116 }
117 0 return $self->call(Tomba::Client::FINDER_PATH, $params);
118 }
119  
120 #-------------------------------------------------------------------------------
121 # Enrichment
122 #-------------------------------------------------------------------------------
123  
124 =head2 Enrichment
125  
126 my $data = $tomba->Enrichment("b.mohamed@tomba.io");
127  
128 The Enrichment API lets you look up person and company data based on an email.
129 Retrieve a person's name, location and social handles from an email.
130  
131 See L<https://docs.tomba.io/api/enrichment#get-enrich>
132  
133 =cut
134  
135 0 ▶sub Enrichment {
Subroutine Enrichment: not called CC=4 SCAR=30.0
Pod documented
136 0 my ($self, $email, $opts) = @_;
137 0 my $params = {
138 email => $email,
139 };
140 0 ▶ if ($opts && ref($opts) eq 'HASH') {
Branch: 1 branch
BranchTrueFalseTotal
if ($opts and ref $opts eq "HASH") 0 0 0
Condition0%0/3
$opts and ref $opts eq "HASH"
!ll&&!rl&&r
000
MC/DC0%0/2
$opts and ref $opts eq "HASH"
$opts ref $opts eq "HASH"
Truth table0%0/3
A and B
A= $optsB= ref $opts eq "HASH"
ABresult
0X0
100
111
141 0 ▶ $params->{webhook_url} = $opts->{webhook_url} if exists $opts->{webhook_url};
Branch: 1 branch
BranchTrueFalseTotal
if exists $opts->{"webhook_url"} 0 0 0
142 }
143 0 return $self->call(Tomba::Client::ENRICHMENT_PATH, $params);
144 }
145  
146 #-------------------------------------------------------------------------------
147 # Author Finder
148 #-------------------------------------------------------------------------------
149  
150 =head2 AuthorFinder
151  
152 my $data = $tomba->AuthorFinder("https://clearbit.com/blog/company-name-to-domain-api");
153  
154 Generates or retrieves the most likely email address from a blog post URL.
155  
156 See L<https://docs.tomba.io/api/finder#get-author-finder>
157  
158 =cut
159  
160 0 ▶sub AuthorFinder {
Subroutine AuthorFinder: not called CC=4 SCAR=30.0
Pod documented
161 0 my ($self, $url, $opts) = @_;
162 0 my $params = {
163 url => $url,
164 };
165 0 ▶ if ($opts && ref($opts) eq 'HASH') {
Branch: 1 branch
BranchTrueFalseTotal
if ($opts and ref $opts eq "HASH") 0 0 0
Condition0%0/3
$opts and ref $opts eq "HASH"
!ll&&!rl&&r
000
MC/DC0%0/2
$opts and ref $opts eq "HASH"
$opts ref $opts eq "HASH"
Truth table0%0/3
A and B
A= $optsB= ref $opts eq "HASH"
ABresult
0X0
100
111
166 0 ▶ $params->{webhook_url} = $opts->{webhook_url} if exists $opts->{webhook_url};
Branch: 1 branch
BranchTrueFalseTotal
if exists $opts->{"webhook_url"} 0 0 0
167 }
168 0 return $self->call(Tomba::Client::AUTHOR_PATH, $params);
169 }
170  
171 #-------------------------------------------------------------------------------
172 # Linkedin Finder
173 #-------------------------------------------------------------------------------
174  
175 =head2 LinkedinFinder
176  
177 my $data = $tomba->LinkedinFinder("https://www.linkedin.com/in/alex-maccaw-ab592978");
178  
179 Generates or retrieves the most likely email address from a LinkedIn URL.
180  
181 See L<https://docs.tomba.io/api/finder#get-linkedin>
182  
183 =cut
184  
185 0 ▶sub LinkedinFinder {
Subroutine LinkedinFinder: not called CC=4 SCAR=30.0
Pod documented
186 0 my ($self, $url, $opts) = @_;
187 0 my $params = {
188 url => $url,
189 };
190 0 ▶ if ($opts && ref($opts) eq 'HASH') {
Branch: 1 branch
BranchTrueFalseTotal
if ($opts and ref $opts eq "HASH") 0 0 0
Condition0%0/3
$opts and ref $opts eq "HASH"
!ll&&!rl&&r
000
MC/DC0%0/2
$opts and ref $opts eq "HASH"
$opts ref $opts eq "HASH"
Truth table0%0/3
A and B
A= $optsB= ref $opts eq "HASH"
ABresult
0X0
100
111
191 0 ▶ $params->{webhook_url} = $opts->{webhook_url} if exists $opts->{webhook_url};
Branch: 1 branch
BranchTrueFalseTotal
if exists $opts->{"webhook_url"} 0 0 0
192 }
193 0 return $self->call(Tomba::Client::LINKEDIN_PATH, $params);
194 }
195  
196 #-------------------------------------------------------------------------------
197 # Delegated methods from service modules
198 #-------------------------------------------------------------------------------
199  
200 ## no critic (Subroutines::RequireArgUnpacking)
201  
202 # Account (from Tomba::Account)
203 0 ▶sub Account { return Tomba::Account::Account(@_) }
Subroutine Account: not called CC=1 SCAR=6.9
Pod documented
204  
205 # Domain (from Tomba::Domain)
206 0 ▶sub DomainSearch { return Tomba::Domain::DomainSearch(@_) }
Subroutine DomainSearch: not called CC=1 SCAR=6.9
Pod documented
207  
208 # Verifier (from Tomba::Verifier)
209 0 ▶sub EmailVerifier { return Tomba::Verifier::EmailVerifier(@_) }
Subroutine EmailVerifier: not called CC=1 SCAR=6.9
Pod documented
210  
211 # Phone (from Tomba::Phone)
212 0 ▶sub PhoneFinder { return Tomba::Phone::PhoneFinder(@_) }
Subroutine PhoneFinder: not called CC=1 SCAR=6.9
Pod documented
213 0 ▶sub PhoneValidator { return Tomba::Phone::PhoneValidator(@_) }
Subroutine PhoneValidator: not called CC=1 SCAR=6.9
Pod documented
214  
215 # Count (from Tomba::Count)
216 0 ▶sub Count { return Tomba::Count::Count(@_) }
Subroutine Count: not called CC=1 SCAR=6.9
Pod documented
217  
218 # Status (from Tomba::Status)
219 0 ▶sub Status { return Tomba::Status::Status(@_) }
Subroutine Status: not called CC=1 SCAR=6.9
Pod documented
220 0 ▶sub Autocomplete { return Tomba::Status::Autocomplete(@_) }
Subroutine Autocomplete: not called CC=1 SCAR=6.9
Pod documented
221  
222 # Sources (from Tomba::Sources)
223 0 ▶sub EmailSources { return Tomba::Sources::EmailSources(@_) }
Subroutine EmailSources: not called CC=1 SCAR=6.9
Pod documented
224  
225 # Format (from Tomba::Format)
226 0 ▶sub EmailFormat { return Tomba::Format::EmailFormat(@_) }
Subroutine EmailFormat: not called CC=1 SCAR=6.9
Pod documented
227  
228 # Similar (from Tomba::Similar)
229 0 ▶sub Similar { return Tomba::Similar::Similar(@_) }
Subroutine Similar: not called CC=1 SCAR=6.9
Pod documented
230  
231 # Technology (from Tomba::Technology)
232 0 ▶sub Technology { return Tomba::Technology::Technology(@_) }
Subroutine Technology: not called CC=1 SCAR=6.9
Pod documented
233  
234 # Location (from Tomba::Location)
235 0 ▶sub GetLocation { return Tomba::Location::GetLocation(@_) }
Subroutine GetLocation: not called CC=1 SCAR=6.9
Pod documented
236  
237 # Enrichment - Clearbit-compatible (from Tomba::Enrichment)
238 0 ▶sub PersonFind { return Tomba::Enrichment::PersonFind(@_) }
Subroutine PersonFind: not called CC=1 SCAR=6.9
Pod documented
239 0 ▶sub CompanyFind { return Tomba::Enrichment::CompanyFind(@_) }
Subroutine CompanyFind: not called CC=1 SCAR=6.9
Pod documented
240 0 ▶sub CombinedFind { return Tomba::Enrichment::CombinedFind(@_) }
Subroutine CombinedFind: not called CC=1 SCAR=6.9
Pod documented
241  
242 # Reveal (from Tomba::Reveal)
243 0 ▶sub CompaniesSearch { return Tomba::Reveal::CompaniesSearch(@_) }
Subroutine CompaniesSearch: not called CC=1 SCAR=6.9
Pod documented
244  
245 # Keys (from Tomba::Keys)
246 0 ▶sub ListKeys { return Tomba::Keys::ListKeys(@_) }
Subroutine ListKeys: not called CC=1 SCAR=6.9
Pod documented
247 0 ▶sub GetKey { return Tomba::Keys::GetKey(@_) }
Subroutine GetKey: not called CC=1 SCAR=6.9
Pod documented
248 0 ▶sub CreateKey { return Tomba::Keys::CreateKey(@_) }
Subroutine CreateKey: not called CC=1 SCAR=6.9
Pod documented
249 0 ▶sub ResetKey { return Tomba::Keys::ResetKey(@_) }
Subroutine ResetKey: not called CC=1 SCAR=6.9
Pod documented
250 0 ▶sub DeleteKey { return Tomba::Keys::DeleteKey(@_) }
Subroutine DeleteKey: not called CC=1 SCAR=6.9
Pod documented
251  
252 # Usage (from Tomba::Usage)
253 0 ▶sub Usage { return Tomba::Usage::Usage(@_) }
Subroutine Usage: not called CC=1 SCAR=6.9
Pod documented
254  
255 # Logs (from Tomba::Logs)
256 0 ▶sub Logs { return Tomba::Logs::Logs(@_) }
Subroutine Logs: not called CC=1 SCAR=6.9
Pod documented
257  
258 # Flag (from Tomba::Flag)
259 0 ▶sub ListFlags { return Tomba::Flag::ListFlags(@_) }
Subroutine ListFlags: not called CC=1 SCAR=6.9
Pod documented
260 0 ▶sub CreateFlag { return Tomba::Flag::CreateFlag(@_) }
Subroutine CreateFlag: not called CC=1 SCAR=6.9
Pod documented
261  
262 # Leads (from Tomba::Leads)
263 0 ▶sub ListLeads { return Tomba::Leads::ListLeads(@_) }
Subroutine ListLeads: not called CC=1 SCAR=6.9
Pod documented
264 0 ▶sub GetLead { return Tomba::Leads::GetLead(@_) }
Subroutine GetLead: not called CC=1 SCAR=6.9
Pod documented
265 0 ▶sub CreateLead { return Tomba::Leads::CreateLead(@_) }
Subroutine CreateLead: not called CC=1 SCAR=6.9
Pod documented
266 0 ▶sub UpdateLead { return Tomba::Leads::UpdateLead(@_) }
Subroutine UpdateLead: not called CC=1 SCAR=6.9
Pod documented
267 0 ▶sub DeleteLead { return Tomba::Leads::DeleteLead(@_) }
Subroutine DeleteLead: not called CC=1 SCAR=6.9
Pod documented
268  
269 # LeadsList (from Tomba::LeadsList)
270 0 ▶sub ListLeadsLists { return Tomba::LeadsList::ListLeadsLists(@_) }
Subroutine ListLeadsLists: not called CC=1 SCAR=6.9
Pod documented
271 0 ▶sub GetLeadsList { return Tomba::LeadsList::GetLeadsList(@_) }
Subroutine GetLeadsList: not called CC=1 SCAR=6.9
Pod documented
272 0 ▶sub CreateLeadsList { return Tomba::LeadsList::CreateLeadsList(@_) }
Subroutine CreateLeadsList: not called CC=1 SCAR=6.9
Pod documented
273 0 ▶sub UpdateLeadsList { return Tomba::LeadsList::UpdateLeadsList(@_) }
Subroutine UpdateLeadsList: not called CC=1 SCAR=6.9
Pod documented
274 0 ▶sub DeleteLeadsList { return Tomba::LeadsList::DeleteLeadsList(@_) }
Subroutine DeleteLeadsList: not called CC=1 SCAR=6.9
Pod documented
275  
276 # LeadsAttributes (from Tomba::LeadsAttributes)
277 0 ▶sub ListAttributes { return Tomba::LeadsAttributes::ListAttributes(@_) }
Subroutine ListAttributes: not called CC=1 SCAR=6.9
Pod documented
278 0 ▶sub GetAttribute { return Tomba::LeadsAttributes::GetAttribute(@_) }
Subroutine GetAttribute: not called CC=1 SCAR=6.9
Pod documented
279 0 ▶sub CreateAttribute { return Tomba::LeadsAttributes::CreateAttribute(@_) }
Subroutine CreateAttribute: not called CC=1 SCAR=6.9
Pod documented
280 0 ▶sub UpdateAttribute { return Tomba::LeadsAttributes::UpdateAttribute(@_) }
Subroutine UpdateAttribute: not called CC=1 SCAR=6.9
Pod documented
281 0 ▶sub DeleteAttribute { return Tomba::LeadsAttributes::DeleteAttribute(@_) }
Subroutine DeleteAttribute: not called CC=1 SCAR=6.9
Pod documented
282  
283 # Bulk (from Tomba::Bulk)
284 0 ▶sub ListBulks { return Tomba::Bulk::ListBulks(@_) }
Subroutine ListBulks: not called CC=1 SCAR=6.9
Pod documented
285 0 ▶sub GetBulk { return Tomba::Bulk::GetBulk(@_) }
Subroutine GetBulk: not called CC=1 SCAR=6.9
Pod documented
286 0 ▶sub LaunchBulk { return Tomba::Bulk::LaunchBulk(@_) }
Subroutine LaunchBulk: not called CC=1 SCAR=6.9
Pod documented
287 0 ▶sub DeleteBulk { return Tomba::Bulk::DeleteBulk(@_) }
Subroutine DeleteBulk: not called CC=1 SCAR=6.9
Pod documented
288 0 ▶sub ArchiveBulk { return Tomba::Bulk::ArchiveBulk(@_) }
Subroutine ArchiveBulk: not called CC=1 SCAR=6.9
Pod documented
289 0 ▶sub RenameBulk { return Tomba::Bulk::RenameBulk(@_) }
Subroutine RenameBulk: not called CC=1 SCAR=6.9
Pod documented
290 0 ▶sub BulkProgress { return Tomba::Bulk::BulkProgress(@_) }
Subroutine BulkProgress: not called CC=1 SCAR=6.9
Pod documented
291 0 ▶sub BulkDownload { return Tomba::Bulk::BulkDownload(@_) }
Subroutine BulkDownload: not called CC=1 SCAR=6.9
Pod documented
292  
293 ## use critic
294  
295 4 1;
296 __END__
« Bulk.pm ↑ Summary Phone.pm »