patreon 0.0.6 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/patreon/api.rb +7 -0
  3. data/patreon.gemspec +1 -1
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 80354b3a765d27d4a988e50f74e55ae9cfc56f09
4
- data.tar.gz: 92f0dc26d9e66f4bd30df489301b38507bc75171
3
+ metadata.gz: 099dc7242a83f365e34627068869909c160a4ad8
4
+ data.tar.gz: 5a05a3f08d9dc9738771a470cab0fe25b2f7d2c9
5
5
  SHA512:
6
- metadata.gz: 6dab3bff382d6517f22f175ae5cc029cbf5250229bfcf900aee717124cc126e5eb33184086727a1c0213ed6e4aba223570036c3727e34f16f99dcf7a109b439c
7
- data.tar.gz: b961bbb611db5428891b886426e3b19a886e37913795389e1dab9e14026fabe2ea077f2becf79ac3581ec7eaa5f11e28bb36fd0e1bc048e05ec896cc5fcc6743
6
+ metadata.gz: 548b98fb4223e057bdec954107651b1fddf21fe100e430617c7bf4aa1d964471b02c67a58b0a90ec5d5c0019f92a8f270e7cff9b08db2aa30175177a29cdfb62
7
+ data.tar.gz: 0aa98b2f5aa6d7cb100cca8effb0aba6e5662b0e7de0145a2beb74518b0e972d50a0dd3846390a23973753189584d413af92d133dc96a22cd34c6cd5909f1687
@@ -1,4 +1,5 @@
1
1
  require 'net/http'
2
+ require 'cgi'
2
3
  require 'json'
3
4
 
4
5
  module Patreon
@@ -19,6 +20,12 @@ module Patreon
19
20
  get_json('current_user/campaigns?include=rewards,creator,goals')
20
21
  end
21
22
 
23
+ def fetch_page_of_pledges(campaign_id, page_size, cursor=nil)
24
+ url = "campaigns/#{campaign_id}/pledges?page%5Bcount%5D=#{CGI::escape(page_size.to_s)}"
25
+ url += "&page%5Bcursor%5D=#{CGI::escape(cursor.to_s)}" if cursor
26
+ get_json(url)
27
+ end
28
+
22
29
  private
23
30
 
24
31
  def get_json(suffix)
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "patreon"
7
- gem.version = "0.0.6"
7
+ gem.version = "0.1.0"
8
8
  gem.authors = ["David Kettler"]
9
9
  gem.email = ["david@patreon.com"]
10
10
  gem.description = "Interact with the Patreon API via OAuth"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: patreon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Kettler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-16 00:00:00.000000000 Z
11
+ date: 2015-12-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Interact with the Patreon API via OAuth
14
14
  email:
@@ -43,7 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
43
43
  version: '0'
44
44
  requirements: []
45
45
  rubyforge_project:
46
- rubygems_version: 2.2.2
46
+ rubygems_version: 2.4.8
47
47
  signing_key:
48
48
  specification_version: 4
49
49
  summary: Visit patreon.com/oauth2/documentation for more information.