repltalk 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/queries.rb +114 -596
- data/lib/repltalk.rb +10 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c6e169fd4bb10c07f2e03fad9d16f8675ddd37cc8f3bb38a65948a557c9c723
|
4
|
+
data.tar.gz: 92b05683f1c566903c8d08b2c4b9e6dc95eec2c776de8f8bdcd67160229215d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04f8a5defd2c471633e07fc2ebabf4c99cea2cfaa25ce7809951f8a388346110eaefb171ad335a07a704ac8ca0eea07b602ed70009464ea84f0c8cfeaeaf4684
|
7
|
+
data.tar.gz: 628cdff810a29a5702e65f1db0e3bed0dc4d17c9446e99dd3d49f3ffcba01e4f4fca0079b109833b5d12910f4d47b8cfe65fd06176fb92c6827f5663ade8c36c
|
data/lib/queries.rb
CHANGED
@@ -1,656 +1,174 @@
|
|
1
1
|
class Queries
|
2
|
+
@@roles = "
|
3
|
+
id
|
4
|
+
name
|
5
|
+
key
|
6
|
+
tagline
|
7
|
+
"
|
8
|
+
|
9
|
+
@@organization = "
|
10
|
+
id
|
11
|
+
name
|
12
|
+
"
|
13
|
+
|
14
|
+
@@language = "
|
15
|
+
id
|
16
|
+
key
|
17
|
+
displayName
|
18
|
+
tagline
|
19
|
+
icon
|
20
|
+
"
|
21
|
+
|
22
|
+
@@board = "
|
23
|
+
id
|
24
|
+
name
|
25
|
+
color
|
26
|
+
"
|
27
|
+
|
28
|
+
@@user = "
|
29
|
+
id
|
30
|
+
fullName
|
31
|
+
username
|
32
|
+
image
|
33
|
+
bio
|
34
|
+
karma
|
35
|
+
isHacker
|
36
|
+
timeCreated
|
37
|
+
roles {
|
38
|
+
#{@@roles}
|
39
|
+
}
|
40
|
+
organization {
|
41
|
+
#{@@organization}
|
42
|
+
}
|
43
|
+
languages {
|
44
|
+
#{@@language}
|
45
|
+
}
|
46
|
+
"
|
47
|
+
|
48
|
+
@@repl = "
|
49
|
+
id
|
50
|
+
url
|
51
|
+
title
|
52
|
+
description
|
53
|
+
isPrivate
|
54
|
+
isAlwaysOn
|
55
|
+
lang {
|
56
|
+
#{@@language}
|
57
|
+
}
|
58
|
+
user {
|
59
|
+
#{@@user}
|
60
|
+
}
|
61
|
+
"
|
62
|
+
|
63
|
+
@@post = "
|
64
|
+
id
|
65
|
+
title
|
66
|
+
body
|
67
|
+
preview(removeMarkdown: true, length: 150)
|
68
|
+
url
|
69
|
+
commentCount
|
70
|
+
isHidden
|
71
|
+
isPinned
|
72
|
+
isLocked
|
73
|
+
isAnnouncement
|
74
|
+
timeCreated
|
75
|
+
isAnswered
|
76
|
+
isAnswerable
|
77
|
+
voteCount
|
78
|
+
canVote
|
79
|
+
hasVoted
|
80
|
+
user {
|
81
|
+
#{@@user}
|
82
|
+
}
|
83
|
+
repl {
|
84
|
+
#{@@repl}
|
85
|
+
}
|
86
|
+
board {
|
87
|
+
#{@@board}
|
88
|
+
}
|
89
|
+
"
|
90
|
+
|
91
|
+
@@comment = "
|
92
|
+
id
|
93
|
+
body
|
94
|
+
timeCreated
|
95
|
+
url
|
96
|
+
isAnswer
|
97
|
+
voteCount
|
98
|
+
canVote
|
99
|
+
hasVoted
|
100
|
+
user {
|
101
|
+
#{@@user}
|
102
|
+
}
|
103
|
+
post {
|
104
|
+
id
|
105
|
+
}
|
106
|
+
"
|
107
|
+
|
108
|
+
|
2
109
|
def Queries.get_user
|
3
110
|
"query userByUsername($username: String!) {
|
4
111
|
user: userByUsername(username: $username) {
|
5
|
-
|
6
|
-
username
|
7
|
-
fullName
|
8
|
-
image
|
9
|
-
url
|
10
|
-
...ProfileHeaderUser
|
11
|
-
__typename
|
12
|
-
}
|
13
|
-
}
|
14
|
-
|
15
|
-
fragment ProfileHeaderUser on User {
|
16
|
-
id
|
17
|
-
fullName
|
18
|
-
username
|
19
|
-
image
|
20
|
-
bio
|
21
|
-
karma
|
22
|
-
isHacker
|
23
|
-
timeCreated
|
24
|
-
roles {
|
25
|
-
id
|
26
|
-
name
|
27
|
-
key
|
28
|
-
tagline
|
29
|
-
__typename
|
30
|
-
}
|
31
|
-
organization {
|
32
|
-
id
|
33
|
-
name
|
34
|
-
__typename
|
35
|
-
}
|
36
|
-
languages {
|
37
|
-
id
|
38
|
-
key
|
39
|
-
displayName
|
40
|
-
tagline
|
41
|
-
icon
|
42
|
-
__typename
|
112
|
+
#{@@user}
|
43
113
|
}
|
44
|
-
__typename
|
45
114
|
}"
|
46
115
|
end
|
47
116
|
|
48
117
|
def Queries.get_user_by_id
|
49
118
|
"query user($user_id: Int!) {
|
50
119
|
user: user(id: $user_id) {
|
51
|
-
|
52
|
-
username
|
53
|
-
fullName
|
54
|
-
image
|
55
|
-
url
|
56
|
-
...ProfileHeaderUser
|
57
|
-
__typename
|
120
|
+
#{@@user}
|
58
121
|
}
|
59
|
-
}
|
60
|
-
|
61
|
-
fragment ProfileHeaderUser on User {
|
62
|
-
id
|
63
|
-
fullName
|
64
|
-
username
|
65
|
-
image
|
66
|
-
bio
|
67
|
-
karma
|
68
|
-
isHacker
|
69
|
-
timeCreated
|
70
|
-
roles {
|
71
|
-
id
|
72
|
-
name
|
73
|
-
key
|
74
|
-
tagline
|
75
|
-
__typename
|
76
|
-
}
|
77
|
-
organization {
|
78
|
-
id
|
79
|
-
name
|
80
|
-
__typename
|
81
|
-
}
|
82
|
-
languages {
|
83
|
-
id
|
84
|
-
key
|
85
|
-
displayName
|
86
|
-
tagline
|
87
|
-
icon
|
88
|
-
__typename
|
89
|
-
}
|
90
|
-
__typename
|
91
122
|
}"
|
92
123
|
end
|
93
124
|
|
94
125
|
def Queries.get_user_posts
|
95
126
|
"query ProfilePosts($username: String!, $after: String, $order: String, $count: Int) {
|
96
127
|
user: userByUsername(username: $username) {
|
97
|
-
id
|
98
|
-
displayName
|
99
128
|
posts(after: $after, order: $order, count: $count) {
|
100
129
|
items {
|
101
|
-
|
102
|
-
isHidden
|
103
|
-
...PostsFeedItemPost
|
104
|
-
board {
|
105
|
-
id
|
106
|
-
name
|
107
|
-
url
|
108
|
-
color
|
109
|
-
__typename
|
110
|
-
}
|
111
|
-
__typename
|
112
|
-
}
|
113
|
-
pageInfo {
|
114
|
-
nextCursor
|
115
|
-
__typename
|
130
|
+
#{@@post}
|
116
131
|
}
|
117
|
-
__typename
|
118
132
|
}
|
119
|
-
__typename
|
120
133
|
}
|
121
|
-
}
|
122
|
-
|
123
|
-
fragment PostsFeedItemPost on Post {
|
124
|
-
id
|
125
|
-
title
|
126
|
-
body
|
127
|
-
preview(removeMarkdown: true, length: 150)
|
128
|
-
url
|
129
|
-
commentCount
|
130
|
-
isPinned
|
131
|
-
isLocked
|
132
|
-
isAnnouncement
|
133
|
-
timeCreated
|
134
|
-
isAnswered
|
135
|
-
isAnswerable
|
136
|
-
...PostVoteControlPost
|
137
|
-
...PostLinkPost
|
138
|
-
user {
|
139
|
-
id
|
140
|
-
username
|
141
|
-
isHacker
|
142
|
-
image
|
143
|
-
...UserLabelUser
|
144
|
-
...UserLinkUser
|
145
|
-
__typename
|
146
|
-
}
|
147
|
-
repl {
|
148
|
-
id
|
149
|
-
url
|
150
|
-
title
|
151
|
-
description
|
152
|
-
isPrivate
|
153
|
-
isAlwaysOn
|
154
|
-
lang {
|
155
|
-
id
|
156
|
-
icon
|
157
|
-
key
|
158
|
-
displayName
|
159
|
-
tagline
|
160
|
-
__typename
|
161
|
-
}
|
162
|
-
__typename
|
163
|
-
}
|
164
|
-
board {
|
165
|
-
id
|
166
|
-
name
|
167
|
-
color
|
168
|
-
__typename
|
169
|
-
}
|
170
|
-
}
|
171
|
-
|
172
|
-
fragment PostVoteControlPost on Post {
|
173
|
-
id
|
174
|
-
voteCount
|
175
|
-
canVote
|
176
|
-
hasVoted
|
177
|
-
__typename
|
178
|
-
}
|
179
|
-
|
180
|
-
fragment PostLinkPost on Post {
|
181
|
-
id
|
182
|
-
url
|
183
|
-
__typename
|
184
|
-
}
|
185
|
-
|
186
|
-
fragment UserLabelUser on User {
|
187
|
-
id
|
188
|
-
username
|
189
|
-
karma
|
190
|
-
...UserLinkUser
|
191
|
-
__typename
|
192
|
-
}
|
193
|
-
|
194
|
-
fragment UserLinkUser on User {
|
195
|
-
id
|
196
|
-
url
|
197
|
-
username
|
198
|
-
timeCreated
|
199
|
-
roles {
|
200
|
-
id
|
201
|
-
name
|
202
|
-
key
|
203
|
-
tagline
|
204
|
-
__typename
|
205
|
-
}
|
206
|
-
organization {
|
207
|
-
id
|
208
|
-
name
|
209
|
-
__typename
|
210
|
-
}
|
211
|
-
languages {
|
212
|
-
id
|
213
|
-
key
|
214
|
-
displayName
|
215
|
-
tagline
|
216
|
-
icon
|
217
|
-
__typename
|
218
|
-
}
|
219
|
-
__typename
|
220
134
|
}"
|
221
135
|
end
|
222
136
|
|
223
137
|
def Queries.get_user_comments
|
224
138
|
"query ProfileComments($username: String!, $after: String, $order: String, $count: Int) {
|
225
139
|
user: userByUsername(username: $username) {
|
226
|
-
id
|
227
|
-
displayName
|
228
140
|
comments(after: $after, order: $order, count: $count) {
|
229
141
|
items {
|
230
|
-
|
231
|
-
...ProfileCommentsComment
|
232
|
-
__typename
|
233
|
-
}
|
234
|
-
pageInfo {
|
235
|
-
nextCursor
|
236
|
-
__typename
|
142
|
+
#{@@comment}
|
237
143
|
}
|
238
|
-
__typename
|
239
|
-
}
|
240
|
-
__typename
|
241
|
-
}
|
242
|
-
}
|
243
|
-
|
244
|
-
fragment ProfileCommentsComment on Comment {
|
245
|
-
id
|
246
|
-
body
|
247
|
-
timeCreated
|
248
|
-
url
|
249
|
-
isAnswer
|
250
|
-
...CommentVoteControlComment
|
251
|
-
user {
|
252
|
-
id
|
253
|
-
fullName
|
254
|
-
username
|
255
|
-
image
|
256
|
-
bio
|
257
|
-
karma
|
258
|
-
isHacker
|
259
|
-
timeCreated
|
260
|
-
roles {
|
261
|
-
id
|
262
|
-
name
|
263
|
-
key
|
264
|
-
tagline
|
265
|
-
__typename
|
266
|
-
}
|
267
|
-
organization {
|
268
|
-
id
|
269
|
-
name
|
270
|
-
__typename
|
271
|
-
}
|
272
|
-
languages {
|
273
|
-
id
|
274
|
-
key
|
275
|
-
displayName
|
276
|
-
tagline
|
277
|
-
icon
|
278
|
-
__typename
|
279
144
|
}
|
280
145
|
}
|
281
|
-
post {
|
282
|
-
id
|
283
|
-
title
|
284
|
-
url
|
285
|
-
user {
|
286
|
-
id
|
287
|
-
username
|
288
|
-
url
|
289
|
-
__typename
|
290
|
-
}
|
291
|
-
board {
|
292
|
-
id
|
293
|
-
name
|
294
|
-
url
|
295
|
-
slug
|
296
|
-
__typename
|
297
|
-
}
|
298
|
-
__typename
|
299
|
-
}
|
300
|
-
__typename
|
301
|
-
}
|
302
|
-
|
303
|
-
fragment CommentVoteControlComment on Comment {
|
304
|
-
id
|
305
|
-
voteCount
|
306
|
-
canVote
|
307
|
-
hasVoted
|
308
|
-
__typename
|
309
146
|
}"
|
310
147
|
end
|
311
148
|
|
312
149
|
def Queries.get_post
|
313
150
|
"query post($id: Int!) {
|
314
151
|
post(id: $id) {
|
315
|
-
|
316
|
-
title
|
317
|
-
preview(removeMarkdown: true, length: 150)
|
318
|
-
body
|
319
|
-
isAnnouncement
|
320
|
-
url
|
321
|
-
isAnswerable
|
322
|
-
isHidden
|
323
|
-
answeredBy {
|
324
|
-
id
|
325
|
-
...PostAnsweredCardUser
|
326
|
-
__typename
|
327
|
-
}
|
328
|
-
answer {
|
329
|
-
id
|
330
|
-
...PostAnsweredCardComment
|
331
|
-
__typename
|
332
|
-
}
|
333
|
-
board {
|
334
|
-
id
|
335
|
-
url
|
336
|
-
description
|
337
|
-
slug
|
338
|
-
__typename
|
339
|
-
}
|
340
|
-
...PostDetailPost
|
341
|
-
__typename
|
342
|
-
}
|
343
|
-
}
|
344
|
-
|
345
|
-
fragment PostDetailPost on Post {
|
346
|
-
id
|
347
|
-
title
|
348
|
-
body
|
349
|
-
timeCreated
|
350
|
-
canReport
|
351
|
-
hasReported
|
352
|
-
isAnnouncement
|
353
|
-
isPinned
|
354
|
-
isLocked
|
355
|
-
isHidden
|
356
|
-
commentCount
|
357
|
-
isAnswered
|
358
|
-
isAnswerable
|
359
|
-
...PostVoteControlPost
|
360
|
-
user {
|
361
|
-
id
|
362
|
-
timeCreated
|
363
|
-
roles {
|
364
|
-
id
|
365
|
-
name
|
366
|
-
key
|
367
|
-
tagline
|
368
|
-
__typename
|
369
|
-
}
|
370
|
-
organization {
|
371
|
-
id
|
372
|
-
name
|
373
|
-
__typename
|
374
|
-
}
|
375
|
-
languages {
|
376
|
-
id
|
377
|
-
key
|
378
|
-
displayName
|
379
|
-
tagline
|
380
|
-
icon
|
381
|
-
__typename
|
382
|
-
}
|
383
|
-
...UserPostHeaderUser
|
384
|
-
__typename
|
385
|
-
}
|
386
|
-
repl {
|
387
|
-
id
|
388
|
-
url
|
389
|
-
title
|
390
|
-
description
|
391
|
-
isPrivate
|
392
|
-
isAlwaysOn
|
393
|
-
lang {
|
394
|
-
id
|
395
|
-
icon
|
396
|
-
key
|
397
|
-
displayName
|
398
|
-
tagline
|
399
|
-
__typename
|
400
|
-
}
|
401
|
-
__typename
|
152
|
+
#{@@post}
|
402
153
|
}
|
403
|
-
board {
|
404
|
-
id
|
405
|
-
name
|
406
|
-
color
|
407
|
-
__typename
|
408
|
-
}
|
409
|
-
__typename
|
410
|
-
}
|
411
|
-
|
412
|
-
fragment PostVoteControlPost on Post {
|
413
|
-
id
|
414
|
-
voteCount
|
415
|
-
canVote
|
416
|
-
hasVoted
|
417
|
-
__typename
|
418
|
-
}
|
419
|
-
|
420
|
-
fragment UserPostHeaderUser on User {
|
421
|
-
id
|
422
|
-
image
|
423
|
-
isHacker
|
424
|
-
isModerator: hasRole(role: MODERATOR)
|
425
|
-
isAdmin: hasRole(role: ADMIN)
|
426
|
-
...DepreciatedUserLabelUser
|
427
|
-
...UserLinkUser
|
428
|
-
__typename
|
429
|
-
}
|
430
|
-
|
431
|
-
fragment UserLinkUser on User {
|
432
|
-
id
|
433
|
-
url
|
434
|
-
username
|
435
|
-
__typename
|
436
|
-
}
|
437
|
-
|
438
|
-
fragment DepreciatedUserLabelUser on User {
|
439
|
-
id
|
440
|
-
image
|
441
|
-
username
|
442
|
-
url
|
443
|
-
karma
|
444
|
-
__typename
|
445
|
-
}
|
446
|
-
|
447
|
-
fragment PostAnsweredCardUser on User {
|
448
|
-
id
|
449
|
-
username
|
450
|
-
...DepreciatedUserLabelUser
|
451
|
-
__typename
|
452
|
-
}
|
453
|
-
|
454
|
-
fragment PostAnsweredCardComment on Comment {
|
455
|
-
id
|
456
|
-
url
|
457
|
-
__typename
|
458
154
|
}"
|
459
155
|
end
|
460
156
|
|
461
157
|
def Queries.get_comment
|
462
158
|
"query comment ($id: Int!) {
|
463
159
|
comment(id: $id) {
|
464
|
-
|
465
|
-
url
|
466
|
-
isAnswer
|
467
|
-
...CommentDetailComment
|
468
|
-
comments {
|
469
|
-
id
|
470
|
-
url
|
471
|
-
isAnswer
|
472
|
-
...CommentDetailComment
|
473
|
-
__typename
|
474
|
-
}
|
475
|
-
__typename
|
476
|
-
}
|
477
|
-
}
|
478
|
-
|
479
|
-
fragment DepreciatedUserLabelUser on User {
|
480
|
-
id
|
481
|
-
fullName
|
482
|
-
username
|
483
|
-
image
|
484
|
-
bio
|
485
|
-
karma
|
486
|
-
isHacker
|
487
|
-
timeCreated
|
488
|
-
roles {
|
489
|
-
id
|
490
|
-
name
|
491
|
-
key
|
492
|
-
tagline
|
493
|
-
__typename
|
494
|
-
}
|
495
|
-
organization {
|
496
|
-
id
|
497
|
-
name
|
498
|
-
__typename
|
499
|
-
}
|
500
|
-
languages {
|
501
|
-
id
|
502
|
-
key
|
503
|
-
displayName
|
504
|
-
tagline
|
505
|
-
icon
|
506
|
-
__typename
|
160
|
+
#{@@comment}
|
507
161
|
}
|
508
|
-
__typename
|
509
|
-
}
|
510
|
-
|
511
|
-
fragment CommentDetailComment on Comment {
|
512
|
-
id
|
513
|
-
body
|
514
|
-
timeCreated
|
515
|
-
url
|
516
|
-
isAnswer
|
517
|
-
...CommentVoteControlComment
|
518
|
-
user {
|
519
|
-
id
|
520
|
-
username
|
521
|
-
...DepreciatedUserLabelWithImageUser
|
522
|
-
__typename
|
523
|
-
}
|
524
|
-
post {
|
525
|
-
id
|
526
|
-
__typename
|
527
|
-
}
|
528
|
-
__typename
|
529
|
-
}
|
530
|
-
|
531
|
-
fragment DepreciatedUserLabelWithImageUser on User {
|
532
|
-
id
|
533
|
-
image
|
534
|
-
...DepreciatedUserLabelUser
|
535
|
-
__typename
|
536
|
-
}
|
537
|
-
|
538
|
-
fragment CommentVoteControlComment on Comment {
|
539
|
-
id
|
540
|
-
voteCount
|
541
|
-
canVote
|
542
|
-
hasVoted
|
543
|
-
__typename
|
544
162
|
}"
|
545
163
|
end
|
546
164
|
|
547
165
|
def Queries.get_posts
|
548
166
|
"query PostsFeed($order: String, $after: String, $searchQuery: String, $languages: [String!], $count: Int, $boardSlugs: [String!], $pinAnnouncements: Boolean, $pinPinned: Boolean) {
|
549
167
|
posts(order: $order, after: $after, searchQuery: $searchQuery, languages: $languages, count: $count, boardSlugs: $boardSlugs, pinAnnouncements: $pinAnnouncements, pinPinned: $pinPinned) {
|
550
|
-
pageInfo {
|
551
|
-
nextCursor
|
552
|
-
__typename
|
553
|
-
}
|
554
168
|
items {
|
555
|
-
|
556
|
-
timeCreated
|
557
|
-
...PostsFeedItemPost
|
558
|
-
board {
|
559
|
-
id
|
560
|
-
color
|
561
|
-
name
|
562
|
-
__typename
|
563
|
-
}
|
564
|
-
__typename
|
169
|
+
#{@@post}
|
565
170
|
}
|
566
|
-
__typename
|
567
171
|
}
|
568
|
-
}
|
569
|
-
|
570
|
-
fragment PostsFeedItemPost on Post {
|
571
|
-
id
|
572
|
-
title
|
573
|
-
preview(removeMarkdown: true, length: 150)
|
574
|
-
url
|
575
|
-
commentCount
|
576
|
-
isPinned
|
577
|
-
isLocked
|
578
|
-
isHidden
|
579
|
-
isAnnouncement
|
580
|
-
timeCreated
|
581
|
-
isAnswered
|
582
|
-
isAnswerable
|
583
|
-
...PostVoteControlPost
|
584
|
-
...PostLinkPost
|
585
|
-
user {
|
586
|
-
id
|
587
|
-
fullName
|
588
|
-
username
|
589
|
-
image
|
590
|
-
bio
|
591
|
-
karma
|
592
|
-
isHacker
|
593
|
-
timeCreated
|
594
|
-
roles {
|
595
|
-
id
|
596
|
-
name
|
597
|
-
key
|
598
|
-
tagline
|
599
|
-
__typename
|
600
|
-
}
|
601
|
-
organization {
|
602
|
-
id
|
603
|
-
name
|
604
|
-
__typename
|
605
|
-
}
|
606
|
-
languages {
|
607
|
-
id
|
608
|
-
key
|
609
|
-
displayName
|
610
|
-
tagline
|
611
|
-
icon
|
612
|
-
__typename
|
613
|
-
}
|
614
|
-
__typename
|
615
|
-
}
|
616
|
-
repl {
|
617
|
-
id
|
618
|
-
url
|
619
|
-
title
|
620
|
-
description
|
621
|
-
isPrivate
|
622
|
-
isAlwaysOn
|
623
|
-
lang {
|
624
|
-
id
|
625
|
-
icon
|
626
|
-
key
|
627
|
-
displayName
|
628
|
-
tagline
|
629
|
-
__typename
|
630
|
-
}
|
631
|
-
__typename
|
632
|
-
}
|
633
|
-
board {
|
634
|
-
id
|
635
|
-
name
|
636
|
-
color
|
637
|
-
__typename
|
638
|
-
}
|
639
|
-
__typename
|
640
|
-
}
|
641
|
-
|
642
|
-
fragment PostVoteControlPost on Post {
|
643
|
-
id
|
644
|
-
voteCount
|
645
|
-
canVote
|
646
|
-
hasVoted
|
647
|
-
__typename
|
648
|
-
}
|
649
|
-
|
650
|
-
fragment PostLinkPost on Post {
|
651
|
-
id
|
652
|
-
url
|
653
|
-
__typename
|
654
172
|
}"
|
655
173
|
end
|
656
174
|
end
|
data/lib/repltalk.rb
CHANGED
@@ -52,12 +52,15 @@ end
|
|
52
52
|
|
53
53
|
|
54
54
|
class Repl
|
55
|
-
attr_reader :id, :url, :title, :description, :language, :is_private, :is_always_on
|
55
|
+
attr_reader :id, :url, :title, :author, :description, :language, :is_private, :is_always_on
|
56
|
+
|
57
|
+
def initialize(client, repl)
|
58
|
+
@client = client
|
56
59
|
|
57
|
-
def initialize(repl)
|
58
60
|
@id = repl["id"]
|
59
61
|
@url = repl["url"]
|
60
62
|
@title = repl["title"]
|
63
|
+
@author = User.new(@client, repl["user"])
|
61
64
|
@description = repl["description"]
|
62
65
|
@language = Language.new(repl["lang"])
|
63
66
|
|
@@ -138,7 +141,7 @@ class Post
|
|
138
141
|
@timestamp = post["timeCreated"]
|
139
142
|
|
140
143
|
@board = Board.new(post["board"])
|
141
|
-
@repl = post["repl"] == nil ? nil : Repl.new(post["repl"])
|
144
|
+
@repl = post["repl"] == nil ? nil : Repl.new(@client, post["repl"])
|
142
145
|
@author = post["user"] == nil ? "[deleted user]" : User.new(@client, post["user"])
|
143
146
|
|
144
147
|
@vote_count = post["voteCount"]
|
@@ -243,6 +246,10 @@ class Client
|
|
243
246
|
puts "\e[31mERROR\n#{r}\e[0m"
|
244
247
|
return nil
|
245
248
|
end
|
249
|
+
if data.include?("errors")
|
250
|
+
puts "\e[31mERROR\n#{r}\e[0m"
|
251
|
+
return nil
|
252
|
+
end
|
246
253
|
data = data["data"] if data.include?("data")
|
247
254
|
data
|
248
255
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: repltalk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CodingCactus
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|