deviantart 0.3.5 → 0.3.6
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/.travis.yml +1 -1
- data/README.md +10 -6
- data/Rakefile +6 -6
- data/lib/deviantart/artist_specialty.rb +13 -0
- data/lib/deviantart/base.rb +0 -4
- data/lib/deviantart/client/user.rb +17 -0
- data/lib/deviantart/country_id.rb +248 -0
- data/lib/deviantart/user/update_profile.rb +7 -0
- data/lib/deviantart/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d5bf6c9d3b9303a4e87358ce8e83eac5d39b34a
|
4
|
+
data.tar.gz: 0623fbebfaf2ceef4f4b3a12750536e627666cc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3e3eff87cf0d4c5548be79b9d178cb29f4f3b22b38ae5c79ded8600bff59a78d086761970c2c8163e3d57c90422d3f19b33d4b30bb7455019931c5bdf85381e
|
7
|
+
data.tar.gz: 27c930fae90724d9e7b23a026b50ec5a7eddf5dc5dff6fdd4baccb38c356c6619b8fb6a846bb88f53a5240e736b02984d50594bbc602e6ad040c560c6f795181
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -27,7 +27,7 @@ deviation.title # => deviation's title
|
|
27
27
|
|
28
28
|
## How to Test
|
29
29
|
|
30
|
-
At the first, install gems:
|
30
|
+
At the first, install dependency gems:
|
31
31
|
|
32
32
|
```bash
|
33
33
|
$ cd deviantart
|
@@ -50,7 +50,7 @@ After this, Rake task performs some steps:
|
|
50
50
|
|
51
51
|
- creates named pipe
|
52
52
|
- OAuth consumer server launches internal
|
53
|
-
- opens
|
53
|
+
- opens your browser with authorization page
|
54
54
|
|
55
55
|
```bash
|
56
56
|
$ bundle exec rake real
|
@@ -59,8 +59,8 @@ Open browser for authorization
|
|
59
59
|
```
|
60
60
|
|
61
61
|
The OAuth consumer server writes access token to named pipe and terminates after you permit it on browser.
|
62
|
-
Rake task takes
|
63
|
-
The tests run with
|
62
|
+
Rake task takes authorization code via named pipe.
|
63
|
+
The tests run with it.
|
64
64
|
|
65
65
|
```bash
|
66
66
|
--snip--
|
@@ -77,13 +77,17 @@ Finished in 23.157618292 seconds.
|
|
77
77
|
---------------------------------
|
78
78
|
```
|
79
79
|
|
80
|
-
The
|
80
|
+
The authorization code is cached at `test/fixtures/authorization_code.json`.
|
81
81
|
|
82
82
|
## API
|
83
83
|
|
84
84
|
## Official API Document
|
85
85
|
|
86
|
-
[
|
86
|
+
[DeviantArt & Sta.sh - APIs | Developers | DeviantArt](https://www.deviantart.com/developers/http/v1/20160316)
|
87
|
+
|
88
|
+
And for OAuth 2.0:
|
89
|
+
|
90
|
+
[Authentication | Developers | DeviantArt](https://www.deviantart.com/developers/authentication)
|
87
91
|
|
88
92
|
## License
|
89
93
|
|
data/Rakefile
CHANGED
@@ -10,8 +10,8 @@ OUTPUT_PIPE = 'test/output_pipe'
|
|
10
10
|
test_pettern = FileList['test/**/*_test.rb']
|
11
11
|
|
12
12
|
Rake::TestTask.new(:test) do |t|
|
13
|
-
t.libs <<
|
14
|
-
t.libs <<
|
13
|
+
t.libs << 'test'
|
14
|
+
t.libs << 'lib'
|
15
15
|
t.test_files = test_pettern
|
16
16
|
end
|
17
17
|
|
@@ -77,15 +77,15 @@ file AUTHORIZATION_CODE_FILE do
|
|
77
77
|
File.unlink(OUTPUT_PIPE)
|
78
78
|
end
|
79
79
|
|
80
|
-
task :
|
80
|
+
task access_token: AUTHORIZATION_CODE_FILE
|
81
81
|
|
82
82
|
Rake::TestTask.new(:real) do |t|
|
83
83
|
t.deps << :access_token
|
84
84
|
t.ruby_opts << '-I. -e "ENV[\'REAL\']=\'1\'"'
|
85
85
|
t.loader = :direct
|
86
|
-
t.libs <<
|
87
|
-
t.libs <<
|
86
|
+
t.libs << 'test'
|
87
|
+
t.libs << 'lib'
|
88
88
|
t.test_files = test_pettern
|
89
89
|
end
|
90
90
|
|
91
|
-
task :
|
91
|
+
task default: :test
|
data/lib/deviantart/base.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'deviantart/user'
|
2
|
+
require 'deviantart/user/update_profile'
|
2
3
|
require 'deviantart/user/profile'
|
3
4
|
require 'deviantart/user/friends'
|
4
5
|
require 'deviantart/user/friends/search'
|
@@ -9,6 +10,8 @@ require 'deviantart/user/friends/watching'
|
|
9
10
|
require 'deviantart/user/friends/watch'
|
10
11
|
require 'deviantart/user/friends/unwatch'
|
11
12
|
require 'deviantart/user/damn_token'
|
13
|
+
require 'deviantart/country_id'
|
14
|
+
require 'deviantart/artist_specialty'
|
12
15
|
|
13
16
|
module DeviantArt
|
14
17
|
class Client
|
@@ -21,6 +24,20 @@ module DeviantArt
|
|
21
24
|
perform(DeviantArt::User::Profile, :get, "/api/v1/oauth2/user/profile/#{username.nil? ? '' : username}", params)
|
22
25
|
end
|
23
26
|
|
27
|
+
# Update the users profile information
|
28
|
+
def update_profile(user_is_artist: nil, artist_level: nil, artist_specialty: nil, real_name: nil, tagline: nil, countryid: nil, website: nil, bio: nil)
|
29
|
+
params = {}
|
30
|
+
params['user_is_artist'] = user_is_artist if user_is_artist
|
31
|
+
params['artist_level'] = artist_level if artist_level
|
32
|
+
params['artist_specialty'] = artist_specialty if artist_specialty
|
33
|
+
params['real_name'] = real_name if real_name
|
34
|
+
params['tagline'] = tagline if tagline
|
35
|
+
params['countryid'] = countryid if countryid
|
36
|
+
params['website'] = website if website
|
37
|
+
params['bio'] = bio if bio
|
38
|
+
perform(DeviantArt::User::UpdateProfile, :post, '/api/v1/oauth2/user/profile/update', params)
|
39
|
+
end
|
40
|
+
|
24
41
|
# Get the users list of friends
|
25
42
|
def get_friends(username, offset: 0, limit: 10)
|
26
43
|
params = {}
|
@@ -0,0 +1,248 @@
|
|
1
|
+
module DeviantArt
|
2
|
+
module CountryID
|
3
|
+
Unspecified = 0
|
4
|
+
UnitedStates = 1
|
5
|
+
Canada = 2
|
6
|
+
Afghanistan = 3
|
7
|
+
AlandIslands = 242
|
8
|
+
Albania = 4
|
9
|
+
Algeria = 5
|
10
|
+
AmericanSamoa = 6
|
11
|
+
Andorra = 7
|
12
|
+
Angola = 8
|
13
|
+
Anguilla = 9
|
14
|
+
Antarctica = 10
|
15
|
+
AntiguaAndBarbuda = 11
|
16
|
+
Argentina = 12
|
17
|
+
Armenia = 13
|
18
|
+
Aruba = 14
|
19
|
+
Australia = 15
|
20
|
+
Austria = 16
|
21
|
+
Azerbaijan = 17
|
22
|
+
TheBahamas = 18
|
23
|
+
Bahrain = 19
|
24
|
+
Bangladesh = 20
|
25
|
+
Barbados = 21
|
26
|
+
Belarus = 22
|
27
|
+
Belgium = 23
|
28
|
+
Belize = 24
|
29
|
+
Benin = 25
|
30
|
+
Bermuda = 26
|
31
|
+
Bhutan = 27
|
32
|
+
Bolivia = 28
|
33
|
+
BosniaAndHerzegovina = 29
|
34
|
+
Botswana = 30
|
35
|
+
BouvetIsland = 31
|
36
|
+
Brazil = 32
|
37
|
+
BritishIndianOceanTerritory = 33
|
38
|
+
Brunei = 35
|
39
|
+
Bulgaria = 36
|
40
|
+
BurkinaFaso = 37
|
41
|
+
Burundi = 38
|
42
|
+
Cambodia = 39
|
43
|
+
Cameroon = 40
|
44
|
+
CapeVerde = 41
|
45
|
+
CaymanIslands = 42
|
46
|
+
CentralAfricanRepublic = 43
|
47
|
+
Chad = 44
|
48
|
+
Chile = 45
|
49
|
+
PeoplesRepublicOfChina = 46
|
50
|
+
ChristmasIsland = 47
|
51
|
+
CocosKeelingIslands = 48
|
52
|
+
Colombia = 49
|
53
|
+
Comoros = 50
|
54
|
+
DemocraticRepublicOfTheCongo = 235
|
55
|
+
RepublicOfTheCongo = 51
|
56
|
+
CookIslands = 52
|
57
|
+
CostaRica = 53
|
58
|
+
CoteDIvoire = 106
|
59
|
+
Croatia = 54
|
60
|
+
Cuba = 55
|
61
|
+
Cyprus = 56
|
62
|
+
CzechRepublic = 57
|
63
|
+
Denmark = 58
|
64
|
+
Djibouti = 59
|
65
|
+
Dominica = 60
|
66
|
+
DominicanRepublic = 61
|
67
|
+
EastTimor = 62
|
68
|
+
Ecuador = 63
|
69
|
+
Egypt = 64
|
70
|
+
ElSalvador = 65
|
71
|
+
EquatorialGuinea = 66
|
72
|
+
Eritrea = 67
|
73
|
+
Estonia = 68
|
74
|
+
Ethiopia = 69
|
75
|
+
FalklandIslands = 70
|
76
|
+
FaroeIslands = 71
|
77
|
+
Fiji = 72
|
78
|
+
Finland = 73
|
79
|
+
France = 74
|
80
|
+
FrenchGuiana = 75
|
81
|
+
FrenchPolynesia = 76
|
82
|
+
FrenchSouthernTerritories = 77
|
83
|
+
Gabon = 78
|
84
|
+
Gambia = 79
|
85
|
+
Georgia = 80
|
86
|
+
Germany = 81
|
87
|
+
Ghana = 82
|
88
|
+
Gibraltar = 83
|
89
|
+
Greece = 84
|
90
|
+
Greenland = 85
|
91
|
+
Grenada = 86
|
92
|
+
Guadeloupe = 87
|
93
|
+
Guam = 88
|
94
|
+
Guatemala = 89
|
95
|
+
Guernsey = 243
|
96
|
+
Guinea = 90
|
97
|
+
GuineaBissau = 91
|
98
|
+
Guyana = 92
|
99
|
+
Haiti = 93
|
100
|
+
HeardIslandAndMcDonaldIslands = 94
|
101
|
+
Honduras = 95
|
102
|
+
HongKong = 96
|
103
|
+
Hungary = 97
|
104
|
+
Iceland = 98
|
105
|
+
India = 99
|
106
|
+
Indonesia = 100
|
107
|
+
Iran = 101
|
108
|
+
Iraq = 102
|
109
|
+
Ireland = 103
|
110
|
+
IsleOfMan = 244
|
111
|
+
Israel = 104
|
112
|
+
Italy = 105
|
113
|
+
Jamaica = 107
|
114
|
+
Japan = 108
|
115
|
+
Jersey = 245
|
116
|
+
Jordan = 109
|
117
|
+
Kazakhstan = 110
|
118
|
+
Kenya = 111
|
119
|
+
Kiribati = 112
|
120
|
+
NorthKorea = 113
|
121
|
+
SouthKorea = 114
|
122
|
+
Kuwait = 115
|
123
|
+
Kyrgyzstan = 116
|
124
|
+
Laos = 117
|
125
|
+
Latvia = 118
|
126
|
+
Lebanon = 119
|
127
|
+
Lesotho = 120
|
128
|
+
Liberia = 121
|
129
|
+
Libya = 122
|
130
|
+
Liechtenstein = 123
|
131
|
+
Lithuania = 124
|
132
|
+
Luxembourg = 125
|
133
|
+
Macau = 126
|
134
|
+
Macedonia = 127
|
135
|
+
Madagascar = 128
|
136
|
+
Malawi = 129
|
137
|
+
Malaysia = 130
|
138
|
+
Maldives = 131
|
139
|
+
Mali = 132
|
140
|
+
Malta = 133
|
141
|
+
MarshallIslands = 134
|
142
|
+
Martinique = 135
|
143
|
+
Mauritania = 136
|
144
|
+
Mauritius = 137
|
145
|
+
Mayotte = 138
|
146
|
+
Mexico = 139
|
147
|
+
Micronesia = 140
|
148
|
+
Moldova = 141
|
149
|
+
Monaco = 142
|
150
|
+
Mongolia = 143
|
151
|
+
Montenegro = 241
|
152
|
+
Montserrat = 144
|
153
|
+
Morocco = 145
|
154
|
+
Mozambique = 146
|
155
|
+
Myanmar = 147
|
156
|
+
Namibia = 148
|
157
|
+
Nauru = 149
|
158
|
+
Nepal = 150
|
159
|
+
Netherlands = 151
|
160
|
+
NetherlandsAntilles = 152
|
161
|
+
NewCaledonia = 153
|
162
|
+
NewZealand = 154
|
163
|
+
Nicaragua = 155
|
164
|
+
Niger = 156
|
165
|
+
Nigeria = 157
|
166
|
+
Niue = 158
|
167
|
+
NorfolkIsland = 159
|
168
|
+
NorthernMarianaIslands = 160
|
169
|
+
Norway = 161
|
170
|
+
Oman = 162
|
171
|
+
Pakistan = 163
|
172
|
+
Palau = 164
|
173
|
+
Panama = 165
|
174
|
+
PapuaNewGuinea = 166
|
175
|
+
Paraguay = 167
|
176
|
+
Peru = 168
|
177
|
+
Philippines = 169
|
178
|
+
PitcairnIslands = 170
|
179
|
+
Poland = 171
|
180
|
+
Portugal = 172
|
181
|
+
PuertoRico = 173
|
182
|
+
Qatar = 174
|
183
|
+
Réunion = 175
|
184
|
+
Romania = 176
|
185
|
+
Russia = 177
|
186
|
+
Rwanda = 178
|
187
|
+
SaintHelena = 197
|
188
|
+
SaintKittsAndNevis = 180
|
189
|
+
SaintLucia = 181
|
190
|
+
SaintPierreAndMiquelon = 198
|
191
|
+
SaintVincentAndTheGrenadines = 182
|
192
|
+
Samoa = 183
|
193
|
+
SanMarino = 184
|
194
|
+
SãoTomeAndPrincipe = 185
|
195
|
+
SaudiArabia = 186
|
196
|
+
Senegal = 187
|
197
|
+
Serbia = 234
|
198
|
+
Seychelles = 188
|
199
|
+
SierraLeone = 189
|
200
|
+
Singapore = 190
|
201
|
+
Slovakia = 191
|
202
|
+
Slovenia = 192
|
203
|
+
SolomonIslands = 238
|
204
|
+
Somalia = 193
|
205
|
+
SouthAfrica = 194
|
206
|
+
SouthGeorgiaAndSouthSandwichIslands = 179
|
207
|
+
Spain = 195
|
208
|
+
SriLanka = 196
|
209
|
+
Sudan = 199
|
210
|
+
Suriname = 200
|
211
|
+
Svalbard = 239
|
212
|
+
Swaziland = 202
|
213
|
+
Sweden = 203
|
214
|
+
Switzerland = 204
|
215
|
+
Syria = 205
|
216
|
+
Taiwan = 206
|
217
|
+
Tajikistan = 207
|
218
|
+
Tanzania = 208
|
219
|
+
Thailand = 209
|
220
|
+
Togo = 210
|
221
|
+
Tokelau = 211
|
222
|
+
Tonga = 212
|
223
|
+
TrinidadAndTobago = 213
|
224
|
+
Tunisia = 214
|
225
|
+
Turkey = 215
|
226
|
+
Turkmenistan = 216
|
227
|
+
TurksAndCaicosIslands = 217
|
228
|
+
Tuvalu = 218
|
229
|
+
Uganda = 220
|
230
|
+
Ukraine = 221
|
231
|
+
UnitedArabEmirates = 222
|
232
|
+
UnitedKingdom = 223
|
233
|
+
UnitedStatesMinorOutlyingIslands = 219
|
234
|
+
Uruguay = 224
|
235
|
+
Uzbekistan = 225
|
236
|
+
Vanuatu = 226
|
237
|
+
VaticanCity = 227
|
238
|
+
Venezuela = 228
|
239
|
+
Vietnam = 229
|
240
|
+
BritishVirginIslands = 34
|
241
|
+
UnitedStatesVirginIslands = 230
|
242
|
+
WallisAndFutuna = 231
|
243
|
+
WesternSahara = 232
|
244
|
+
Yemen = 233
|
245
|
+
Zambia = 236
|
246
|
+
Zimbabwe = 237
|
247
|
+
end
|
248
|
+
end
|
data/lib/deviantart/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deviantart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code Ass
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -157,6 +157,7 @@ files:
|
|
157
157
|
- bin/setup
|
158
158
|
- deviantart.gemspec
|
159
159
|
- lib/deviantart.rb
|
160
|
+
- lib/deviantart/artist_specialty.rb
|
160
161
|
- lib/deviantart/authorization_code.rb
|
161
162
|
- lib/deviantart/authorization_code/access_token.rb
|
162
163
|
- lib/deviantart/authorization_code/refresh_token.rb
|
@@ -176,6 +177,7 @@ files:
|
|
176
177
|
- lib/deviantart/collections/folders/create.rb
|
177
178
|
- lib/deviantart/collections/folders/remove.rb
|
178
179
|
- lib/deviantart/collections/unfave.rb
|
180
|
+
- lib/deviantart/country_id.rb
|
179
181
|
- lib/deviantart/data.rb
|
180
182
|
- lib/deviantart/data/countries.rb
|
181
183
|
- lib/deviantart/data/privacy.rb
|
@@ -206,6 +208,7 @@ files:
|
|
206
208
|
- lib/deviantart/user/friends/watching.rb
|
207
209
|
- lib/deviantart/user/profile.rb
|
208
210
|
- lib/deviantart/user/statuses.rb
|
211
|
+
- lib/deviantart/user/update_profile.rb
|
209
212
|
- lib/deviantart/user/watchers.rb
|
210
213
|
- lib/deviantart/user/whois.rb
|
211
214
|
- lib/deviantart/version.rb
|