repltalk 4.0.1 → 4.1.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
  SHA256:
3
- metadata.gz: ca32c6abe912a479dc7c61817f187201159673fbb1552709ba6ea2430d6eaa9c
4
- data.tar.gz: 52227cb7b963b6c1a1f5398ce8352dd223c70dd1a0e089bf6f175fbe253fa6cb
3
+ metadata.gz: 87b86adfe3aef99370ce5a11bfe9648b52bb987c3f9fd35b929ac811720e48c4
4
+ data.tar.gz: acf36ed1601688e319397fed44c32287a00a869daac2258b58f17d92d165abbf
5
5
  SHA512:
6
- metadata.gz: 2c02a0b643517276ecb60d843345dae996855ff0b726f576a824000b1cc21d16fb0d6522d56d87839c12730a488aa616dc1617bdee703d0a524d1b3f4d306abb
7
- data.tar.gz: 98ada7dd72a0646fe6b4312a18b33ad71c36b45cc14f0e0c9bf13759d5cf0da079aa939481b8410c5aca599edc7fe07183aebbca90b26e9b643960a8a4b75119
6
+ metadata.gz: b2ed218280a34de49368f3761a56a37506dafa50c83f0942e6a1b5ea2907b73d367f5a67e1f1d6034c4869b3fd0bcab5e5a5dd78ea1d90e43a1adae4ca902099
7
+ data.tar.gz: 6d62a0d0989c0456235f61b6cf7ed2f5abe0bb23036de7526e325b82eaf8f99cc337fe45523e1cb9a5dcc78a6ed9804f63e6eaa4fe56d84c9b68930e8ff05d57
@@ -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: "new", count: nil, after: nil, search: nil, languages: nil)
135
+ def get_posts(board: "all", order: "New", count: nil, after: nil, search: nil)
136
136
  p = graphql(
137
- "PostsFeed",
137
+ "ReplPostsFeed",
138
138
  GQL::Queries::GET_POSTS,
139
- boardSlugs: [board],
140
- order: order,
141
- count: count,
142
- after: after,
143
- searchQuery: search,
144
- languages: languages
139
+ options: {
140
+ boardSlugs: [board],
141
+ order: order,
142
+ count: count,
143
+ after: after,
144
+ searchQuery: search
145
+ }
145
146
  )
146
- p["posts"]["items"].map { |post| Post.new(self, post) }
147
+ p["replPosts"]["items"].map { |post| Post.new(self, post) }
147
148
  end
148
149
 
149
150
  def get_explore_featured_repls
@@ -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 PostsFeed($order: String, $after: String, $searchQuery: String, $languages: [String!], $count: Int, $boardSlugs: [String!]) {
347
- posts(order: $order, after: $after, searchQuery: $searchQuery, languages: $languages, count: $count, boardSlugs: $boardSlugs) {
333
+ query ReplPostsFeed($options: ReplPostsQueryOptions) {
334
+ replPosts(options: $options) {
348
335
  items {
349
336
  #{Fields::POST}
350
337
  }
@@ -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, :organization, :languages
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
@@ -4,5 +4,5 @@ require_relative "repltalk/structures"
4
4
 
5
5
  module ReplTalk
6
6
  $BASE_URL = "https://replit.com"
7
- VERSION = "4.0.1"
7
+ VERSION = "4.1.0"
8
8
  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: 4.0.1
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-05-15 00:00:00.000000000 Z
11
+ date: 2021-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http