envato-sdk 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eba7d159266289022ad43fd312e12054c515b072
4
- data.tar.gz: f49b48c5cbbbd4b59b7e73cc124780546535ed2f
3
+ metadata.gz: 3b1e5a612b369f84ba4ffa05d328ce11e3fad37b
4
+ data.tar.gz: 90b5fb30a69f862f5d31323a0c19514bec638ac9
5
5
  SHA512:
6
- metadata.gz: b996f5d9ecf3e928b0f0da231f3b7efcd3ac971c42a0549863ac0925bb1510e8b9cd780bbe69f7ef57ee7553a43b405dcdb00291fcfec39f9191ff07bb64e1ae
7
- data.tar.gz: e0731686315465fb4bed7a1837575fb5ca3cbc18251c4001eda983c546efc770dc12eb18ca3489d41c083b163c70b093494bd75caa7cc8d05da3865851a8004c
6
+ metadata.gz: c43e463c51d9dbad4c21aa61cb4076aac9eb79d387dfe8a0f70213ea37df154eae6965b581fb310ec4eae9f7623b8baa3a97c83d566c8d7c5b1e19d1281398a6
7
+ data.tar.gz: 128ab8408d3243989324556415c2eb6b8f6af2febe3234c890c83650a53ecc182aca9bd1081fc1b6ab52214778b8d74c7daf295315e27d38f3b56c49b06f43cd
data/README.md CHANGED
@@ -114,7 +114,7 @@ or array item.
114
114
 
115
115
  ```rb
116
116
  client.user_information('jacobbednarz')
117
- # => {"username": "jacobbednarz","country": "Australia","sales": "0","location": "","image": "https://0.s3.envato.com/files/144155428/avatar.jpg","followers": "4"}
117
+ # => {"username"=>"jacobbednarz", "country"=>"Australia", "sales"=>"0", "location"=>"", "image" => "https://0.s3.envato.com/files/144155428/avatar.jpg", "followers"=>"4"}
118
118
  ```
119
119
 
120
120
  - [`badges_for_user`](https://build.envato.com/api/#market_UserBadges)
@@ -138,6 +138,34 @@ or array item.
138
138
  # => [{"id"=>"22705", "item"=>"Black + White Simple Theme", "url"=>"http://themeforest.net/item/black-white-simple-theme/22705", "user"=>"collis", "thumbnail"=>"https://preview-tf.s3.envato.com/files/60223.jpg", "sales"=>"916", "rating"=>"4.5", "rating_decimal"=>"4.32", "cost"=>"8.00", "uploaded_on"=>"Tue Dec 02 04:01:12 +1100 2008", "last_update"=>"", "tags"=>"clean", "category"=>"psd-templates/creative", "live_preview_url"=>"https://0.s3.envato.com/files/60224/1_home.__large_preview.jpg"}]
139
139
  ```
140
140
 
141
+ - [`sales_per_month`](https://build.envato.com/api/#market_EarningsAndSalesByMonth)
142
+
143
+ ```rb
144
+ client.sales_per_month
145
+ # => [{"month"=>"Mon Jun 01 00:00:00 +1000 2009", "sales"=>"10", "earnings"=>"120.60"} ... ]
146
+ ```
147
+
148
+ - [`user_statement`](https://build.envato.com/api/#market_Statement)
149
+
150
+ ```rb
151
+ client.user_statement
152
+ # => [{"kind"=>"Author Fee", "amount"=>"-1.00", "description"=>"Author Fee for included support sale IVIP1234", "occured_at"=>"Sat Apr 09 05:11:49 +1000 2014"} ... ]
153
+ ```
154
+
155
+ - [`sales`](https://build.envato.com/api/#market_0_Author_Sales)
156
+
157
+ ```rb
158
+ client.sales
159
+ # => [{"amount"=>"20.00", "sold_at"=>"2016-04-09T05:19:48+10:00", "item"=>{"id"=>123456, "name"=>"A cool theme - WordPress","description"=>"This is a theme I made and looks good!", "summary"=>"Widget Ready: Yes" ... ]
160
+ ```
161
+
162
+ - [`sale_by_purchase_code`](https://build.envato.com/api/#market_0_Author_Sale)
163
+
164
+ ```rb
165
+ client.sale_by_purchase_code('1234-5678')
166
+ # => {"amount" => "5.40", "sold_at" => "2009-11-13T19:28:25+11:00", "item" => {"id":1234, "name":"Test theme - HTML","description":"Test description" ... }
167
+ ```
168
+
141
169
  #### Marketplace Stats
142
170
 
143
171
  - [`total_items`](https://build.envato.com/api/#market_TotalItems)
@@ -38,9 +38,24 @@ module Envato
38
38
  response['new-files-from-user']
39
39
  end
40
40
 
41
- def user_collections
42
- response = get 'v3/market/user/collections.json'
43
- response['collections']
41
+ def sales_per_month
42
+ response = get 'v1/market/private/user/earnings-and-sales-by-month.json'
43
+ response['earnings-and-sales-by-month']
44
+ end
45
+
46
+ def user_statement
47
+ response = get 'v1/market/private/user/statement.json'
48
+ response['statement']
49
+ end
50
+
51
+ def sales(page = 1)
52
+ raise TypeError unless page.is_a? Integer
53
+ get "v3/market/author/sales?page=#{page}"
54
+ end
55
+
56
+ def sale_by_purchase_code(purchase_code)
57
+ raise ArgumentError if purchase_code.nil?
58
+ get "v3/market/author/sale?code=#{purchase_code}"
44
59
  end
45
60
  end
46
61
  end
@@ -1,6 +1,6 @@
1
1
  module Envato
2
2
  MAJOR = 0
3
- MINOR = 2
3
+ MINOR = 3
4
4
  PATCH = 0
5
5
  VERSION = [MAJOR, MINOR, PATCH].join '.'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: envato-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jacob Bednarz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-25 00:00:00.000000000 Z
11
+ date: 2016-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -171,9 +171,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
171
  version: '0'
172
172
  requirements: []
173
173
  rubyforge_project:
174
- rubygems_version: 2.5.1
174
+ rubygems_version: 2.2.5
175
175
  signing_key:
176
176
  specification_version: 4
177
177
  summary: SDK for interacting with the Envato API.
178
178
  test_files: []
179
- has_rdoc: