PipedrivePUT 1.1.11 → 1.1.12

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
  SHA1:
3
- metadata.gz: d5d4c6834507e29ef02d463fc2e730624f4283aa
4
- data.tar.gz: 93d52a852e6f911fd906d4faf953780bad7a272d
3
+ metadata.gz: c05f9009e2af21e0e8d6e11394fe8a90e90c7eba
4
+ data.tar.gz: c0f8220c4c8a11bc637d5767e96b5e8064c8cb55
5
5
  SHA512:
6
- metadata.gz: 6a7091636af93bdcf084c2bb381d92cc91b6ef4a42c0c8ab4799519fcc4eab94067b65858e92842535e1afad15d12215218035ce933e267f150c726e5e3ecdfd
7
- data.tar.gz: 6de478d69ee00dde7a3597e278ed5c69689ea2aa019402d1089a93e3ee3b9ab417a4a4a0fcc853141a4d01931ad7df12b8e9b29c7618bc100d5f671f4e150ca2
6
+ metadata.gz: 3076f8307198bac16354ba4c1bba8fe2f4a86326ca75d25a115be3ff1a6c905fa02ff48932fd2ce71ceef245b8ffd1b7d984dfcbc7f3e173e2545fe6d67528cf
7
+ data.tar.gz: 7beb16140803dfbb7211ef83c5ea0b04398a9bc35ac3548889053bc97cfd2f55ba1a9e4fcc70f7638e5e4762480ed10653f814f6f1b32ace6582b1ce76e1828f
data/README.md CHANGED
@@ -144,6 +144,17 @@ Get one Pipeline
144
144
  PipedrivePUT::Pipelines.getOnePipeline(< id >)
145
145
  ```
146
146
 
147
+ ## Recents
148
+
149
+ Get all Recent changes from Pipedrive based on a specific time
150
+ ```ruby
151
+ PipedrivePUT::Recents.getRecent(< Time.now >)
152
+ ```
153
+
154
+ NOTE: This searches for everything in Pipedrive (deal, organization, user, state, product, etc.)
155
+
156
+ I hope to add additional support to break this down at a later time.
157
+
147
158
 
148
159
  Data is returned in JSON format.
149
160
 
@@ -159,7 +170,9 @@ https://developers.pipedrive.com/v1
159
170
 
160
171
  1. Add support for additional arguments when creating a deal
161
172
 
162
- 2. Many other Pipedrive API Calls
173
+ 2. Add ability to search for recent changes by specific types onle (deal, organization, user, state, etc.)
174
+
175
+ 3. Many other Pipedrive API Calls
163
176
 
164
177
 
165
178
  ## Contributing
data/lib/PipedrivePUT.rb CHANGED
@@ -5,6 +5,7 @@ require 'PipedrivePUT/users'
5
5
  require 'PipedrivePUT/deal'
6
6
  require 'PipedrivePUT/persons'
7
7
  require 'PipedrivePUT/pipelines'
8
+ require 'PipedrivePUT/recents'
8
9
 
9
10
  require 'json'
10
11
  require 'open-uri'
@@ -0,0 +1,15 @@
1
+ module PipedrivePUT
2
+ class Recents
3
+
4
+ include PipedrivePUT
5
+
6
+ require 'rest-client'
7
+
8
+ def self.key
9
+ puts @@key
10
+ end
11
+
12
+
13
+
14
+ end
15
+ end
@@ -0,0 +1,54 @@
1
+ module PipedrivePUT
2
+ class Recents
3
+
4
+ include PipedrivePUT
5
+
6
+ require 'rest-client'
7
+
8
+ def self.key
9
+ puts @@key
10
+ end
11
+
12
+
13
+ #gets Recent changes from types in Pipedrive
14
+ def self.getRecent(time)
15
+
16
+ if time.nil?
17
+ raise "No time entered. Correct format is YYYY-MM-DD HH:MM:SS"
18
+ else
19
+ @formattedTime = time.strftime("%F %T")
20
+ puts @formattedTime
21
+ @start = 0
22
+
23
+ table = Array.new
24
+ @more_items = true
25
+ tablesize = 0
26
+
27
+ while @more_items == true do
28
+ count = 0
29
+ puts @more_items
30
+ @base = 'https://api.pipedrive.com/v1/recents?since_timestamp=' + @formattedTime.to_s + '&' + 'start=' + @start.to_s + '&limit=500&api_token=' + @@key.to_s
31
+ puts @base
32
+ @content = open(@base.to_s).read
33
+ @parsed = JSON.parse(@content)
34
+
35
+ while count < @parsed["data"].size
36
+ table.push(@parsed["data"][count])
37
+ table[tablesize] = @parsed["data"][count]
38
+ count = count +1
39
+ tablesize = tablesize + 1
40
+ end
41
+
42
+ @pagination = @parsed['additional_data']['pagination']
43
+ @more_items = @pagination['more_items_in_collection']
44
+ puts @more_items
45
+ @start = @pagination['next_start']
46
+ puts @start
47
+ end
48
+
49
+ return table
50
+ end
51
+ end
52
+
53
+ end
54
+ end
@@ -1,3 +1,3 @@
1
1
  module PipedrivePUT
2
- VERSION = "1.1.11"
2
+ VERSION = "1.1.12"
3
3
  end
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.11
4
+ version: 1.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - JakePens71
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-22 00:00:00.000000000 Z
11
+ date: 2015-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -110,6 +110,8 @@ files:
110
110
  - lib/PipedrivePUT/organization.rb
111
111
  - lib/PipedrivePUT/persons.rb
112
112
  - lib/PipedrivePUT/pipelines.rb
113
+ - lib/PipedrivePUT/recent.rb
114
+ - lib/PipedrivePUT/recents.rb
113
115
  - lib/PipedrivePUT/search.rb
114
116
  - lib/PipedrivePUT/users.rb
115
117
  - lib/PipedrivePUT/version.rb