repltalk 4.0.1 → 4.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/repltalk/client.rb +10 -9
- data/lib/repltalk/graphql.rb +2 -15
- data/lib/repltalk/structures.rb +2 -23
- data/lib/repltalk.rb +1 -1
- 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: 87b86adfe3aef99370ce5a11bfe9648b52bb987c3f9fd35b929ac811720e48c4
|
4
|
+
data.tar.gz: acf36ed1601688e319397fed44c32287a00a869daac2258b58f17d92d165abbf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2ed218280a34de49368f3761a56a37506dafa50c83f0942e6a1b5ea2907b73d367f5a67e1f1d6034c4869b3fd0bcab5e5a5dd78ea1d90e43a1adae4ca902099
|
7
|
+
data.tar.gz: 6d62a0d0989c0456235f61b6cf7ed2f5abe0bb23036de7526e325b82eaf8f99cc337fe45523e1cb9a5dcc78a6ed9804f63e6eaa4fe56d84c9b68930e8ff05d57
|
data/lib/repltalk/client.rb
CHANGED
@@ -132,18 +132,19 @@ module ReplTalk
|
|
132
132
|
u["leaderboard"]["items"].map { |user| LeaderboardUser.new(self, user) }
|
133
133
|
end
|
134
134
|
|
135
|
-
def get_posts(board: "all", order: "
|
135
|
+
def get_posts(board: "all", order: "New", count: nil, after: nil, search: nil)
|
136
136
|
p = graphql(
|
137
|
-
"
|
137
|
+
"ReplPostsFeed",
|
138
138
|
GQL::Queries::GET_POSTS,
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
139
|
+
options: {
|
140
|
+
boardSlugs: [board],
|
141
|
+
order: order,
|
142
|
+
count: count,
|
143
|
+
after: after,
|
144
|
+
searchQuery: search
|
145
|
+
}
|
145
146
|
)
|
146
|
-
p["
|
147
|
+
p["replPosts"]["items"].map { |post| Post.new(self, post) }
|
147
148
|
end
|
148
149
|
|
149
150
|
def get_explore_featured_repls
|
data/lib/repltalk/graphql.rb
CHANGED
@@ -8,16 +8,6 @@ module ReplTalk
|
|
8
8
|
tagline
|
9
9
|
"
|
10
10
|
|
11
|
-
ORGANIZATION = "
|
12
|
-
id
|
13
|
-
name
|
14
|
-
country
|
15
|
-
postalCode
|
16
|
-
state
|
17
|
-
city
|
18
|
-
timeCreated
|
19
|
-
"
|
20
|
-
|
21
11
|
LANGUAGE = "
|
22
12
|
id
|
23
13
|
key
|
@@ -46,9 +36,6 @@ module ReplTalk
|
|
46
36
|
roles {
|
47
37
|
#{ROLES}
|
48
38
|
}
|
49
|
-
organization {
|
50
|
-
#{ORGANIZATION}
|
51
|
-
}
|
52
39
|
languages {
|
53
40
|
#{LANGUAGE}
|
54
41
|
}
|
@@ -343,8 +330,8 @@ module ReplTalk
|
|
343
330
|
"
|
344
331
|
|
345
332
|
GET_POSTS = "
|
346
|
-
query
|
347
|
-
|
333
|
+
query ReplPostsFeed($options: ReplPostsQueryOptions) {
|
334
|
+
replPosts(options: $options) {
|
348
335
|
items {
|
349
336
|
#{Fields::POST}
|
350
337
|
}
|
data/lib/repltalk/structures.rb
CHANGED
@@ -18,26 +18,6 @@ module ReplTalk
|
|
18
18
|
|
19
19
|
|
20
20
|
|
21
|
-
class Organization
|
22
|
-
attr_reader :id, :name, :country, :postal_code, :state, :city, :timestamp
|
23
|
-
|
24
|
-
def initialize(organization)
|
25
|
-
@id = organization["id"]
|
26
|
-
@name = organization["name"]
|
27
|
-
@country = organization["country"]
|
28
|
-
@postal_code = organization["postalCode"]
|
29
|
-
@state = organization["state"]
|
30
|
-
@city = organization["city"]
|
31
|
-
@timestamp = organization["timeCreated"]
|
32
|
-
end
|
33
|
-
|
34
|
-
def to_s
|
35
|
-
@name
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
|
40
|
-
|
41
21
|
class Language
|
42
22
|
attr_reader :id, :key, :name, :tagline, :icon, :category
|
43
23
|
|
@@ -400,7 +380,7 @@ module ReplTalk
|
|
400
380
|
class Post
|
401
381
|
attr_reader :id, :url, :repl, :board, :title, :author, :answer, :content, :preview, :timestamp, :vote_count, :comment_count, :can_vote, :has_voted, :is_answered, :is_answerable, :is_hidden, :is_pinned, :is_locked, :is_announcement
|
402
382
|
|
403
|
-
def initialize(client, post)
|
383
|
+
def initialize(client, post)
|
404
384
|
@client = client
|
405
385
|
|
406
386
|
@id = post["id"]
|
@@ -506,7 +486,7 @@ module ReplTalk
|
|
506
486
|
|
507
487
|
|
508
488
|
class User
|
509
|
-
attr_reader :id, :username, :name, :pfp, :bio, :cycles, :is_hacker, :timestamp, :subscription, :roles, :
|
489
|
+
attr_reader :id, :username, :name, :pfp, :bio, :cycles, :is_hacker, :timestamp, :subscription, :roles, :languages
|
510
490
|
|
511
491
|
def initialize(client, user)
|
512
492
|
return nil if user == nil
|
@@ -521,7 +501,6 @@ module ReplTalk
|
|
521
501
|
@is_hacker = user["isHacker"]
|
522
502
|
@timestamp = user["timeCreated"]
|
523
503
|
@roles = user["roles"].map { |role| Role.new(role) }
|
524
|
-
@organization = user["organization"] == nil ? nil : Organization.new(user["organization"])
|
525
504
|
@languages = user["languages"].map { |lang| Language.new(lang) }
|
526
505
|
end
|
527
506
|
|
data/lib/repltalk.rb
CHANGED
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: 4.0
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CodingCactus
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|