patreon 0.0.6 → 0.1.0
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/patreon/api.rb +7 -0
- data/patreon.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 099dc7242a83f365e34627068869909c160a4ad8
|
4
|
+
data.tar.gz: 5a05a3f08d9dc9738771a470cab0fe25b2f7d2c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 548b98fb4223e057bdec954107651b1fddf21fe100e430617c7bf4aa1d964471b02c67a58b0a90ec5d5c0019f92a8f270e7cff9b08db2aa30175177a29cdfb62
|
7
|
+
data.tar.gz: 0aa98b2f5aa6d7cb100cca8effb0aba6e5662b0e7de0145a2beb74518b0e972d50a0dd3846390a23973753189584d413af92d133dc96a22cd34c6cd5909f1687
|
data/lib/patreon/api.rb
CHANGED
@@ -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)
|
data/patreon.gemspec
CHANGED
@@ -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
|
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
|
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
|
+
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.
|
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.
|