PipedrivePUT 1.1.18 → 1.1.20
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/lib/PipedrivePUT/persons.rb +38 -0
- data/lib/PipedrivePUT/search.rb +13 -13
- data/lib/PipedrivePUT/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b831d0d8b44bcc0bb0a859a182fc7fb633eac3d
|
4
|
+
data.tar.gz: fefc37f4ac1e0ece693e86909f370501eef34b05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: faf280e8d420f8da73b12a6924c3dcf2a4c0c4a1ada64115f74603bc0eb4aac0a05baa5381ed6ae8bc66449288505a6ed02d1612cd8db88ef42ea8fbd1a05f42
|
7
|
+
data.tar.gz: a31eee60f539eacc5f0143fa6b59b8464948161d4b6bd504eeec20c63adf44171c3633b610030d124f73bf3bbded192fd60c403b416e0f9ffd37a75aacdfafdd
|
data/lib/PipedrivePUT/persons.rb
CHANGED
@@ -91,6 +91,44 @@ require 'httparty'
|
|
91
91
|
|
92
92
|
end
|
93
93
|
|
94
|
+
#Search person by name (additional params means organization id)
|
95
|
+
def self.SearchForPerson(term, org_id)
|
96
|
+
|
97
|
+
@start = 0;
|
98
|
+
table = Array.new
|
99
|
+
@more_items = true
|
100
|
+
|
101
|
+
tablesize = 0
|
102
|
+
|
103
|
+
while @more_items == true do
|
104
|
+
count = 0
|
105
|
+
|
106
|
+
@base = 'https://api.pipedrive.com/v1/persons/find?term=' + term.to_s + '&org_id=' + org_id.to_s + '&start=' + @start.to_s + '&limit=500&api_token=' + @@key.to_s
|
107
|
+
|
108
|
+
@content = open(@base.to_s).read
|
109
|
+
@parsed = JSON.parse(@content)
|
110
|
+
|
111
|
+
if @parsed["data"].nil?
|
112
|
+
return "No Persons returned"
|
113
|
+
else
|
114
|
+
|
115
|
+
while count < @parsed["data"].size
|
116
|
+
#table.push(@parsed["data"][count])
|
117
|
+
table[tablesize] = @parsed["data"][count]
|
118
|
+
count = count +1
|
119
|
+
tablesize = tablesize + 1
|
120
|
+
|
121
|
+
end
|
122
|
+
@pagination = @parsed['additional_data']['pagination']
|
123
|
+
@more_items = @pagination['more_items_in_collection']
|
124
|
+
#puts @more_items
|
125
|
+
@start = @pagination['next_start']
|
126
|
+
#puts @start
|
127
|
+
end
|
128
|
+
end
|
129
|
+
return table
|
130
|
+
end
|
131
|
+
|
94
132
|
end
|
95
133
|
|
96
134
|
end
|
data/lib/PipedrivePUT/search.rb
CHANGED
@@ -35,18 +35,18 @@ module PipedrivePUT
|
|
35
35
|
|
36
36
|
#puts @base
|
37
37
|
|
38
|
-
@content =
|
38
|
+
@content = HTTParty.get(@base.to_s)
|
39
39
|
|
40
|
-
|
40
|
+
|
41
41
|
|
42
|
-
|
42
|
+
#@parsed = JSON.parse(@content)
|
43
43
|
|
44
|
-
while count < @
|
45
|
-
table.push(@
|
44
|
+
while count < @content["data"].size
|
45
|
+
table.push(@content["data"][count])
|
46
46
|
count = count +1
|
47
47
|
end
|
48
48
|
|
49
|
-
@pagination = @
|
49
|
+
@pagination = @content['additional_data']['pagination']
|
50
50
|
@more_items = @pagination['more_items_in_collection']
|
51
51
|
#puts @more_items
|
52
52
|
@start = @pagination['next_start']
|
@@ -63,20 +63,20 @@ module PipedrivePUT
|
|
63
63
|
while @more_items == true do
|
64
64
|
@base = 'https://api.pipedrive.com/v1/searchResults?term=' + term.to_s + '&' + @start.to_s + '&limit=500&api_token=' + @@key.to_s
|
65
65
|
count = 0
|
66
|
-
puts @base
|
66
|
+
#puts @base
|
67
67
|
|
68
|
-
@content =
|
68
|
+
@content = HTTParty.get(@base.to_s)
|
69
69
|
|
70
|
-
puts @content
|
70
|
+
#puts @content
|
71
71
|
|
72
|
-
|
72
|
+
#@parsed = JSON.parse(@content)
|
73
73
|
|
74
|
-
while count < @
|
75
|
-
table.push(@
|
74
|
+
while count < @content["data"].size
|
75
|
+
table.push(@content["data"][count])
|
76
76
|
count = count +1
|
77
77
|
end
|
78
78
|
|
79
|
-
@pagination = @
|
79
|
+
@pagination = @content['additional_data']['pagination']
|
80
80
|
@more_items = @pagination['more_items_in_collection']
|
81
81
|
#puts @more_items
|
82
82
|
@start = @pagination['next_start']
|
data/lib/PipedrivePUT/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: PipedrivePUT
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JakePens71
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|