repltalk 0.3.0 → 0.4.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/queries.rb +110 -0
- data/lib/repltalk.rb +14 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8cc752c9239aae73a834123704fefdd7646f448130d67c16a024b394d405a7a4
|
4
|
+
data.tar.gz: dedee8b09c539ee85244bdf0d336d513ff1ee08b221f87c2db2dfa6dcfe8e7c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 687b6e3f7b8ae25c9c2fca8a3fb023f3e176057623c7e0e7ed771e1e6caceec0cd321213a375ed537b29f7b26d29a9d4c4bf450aee743bb4eb66de0d6518191c
|
7
|
+
data.tar.gz: c8f334e85bf25c6508a2a141c4ffa0c0d4aeafd5696cbadcdb7fc3be87e33320ffc60e5c456146b53fd7c06a3c7393d8b50435f2857dbc9d123413c291930a47
|
data/lib/queries.rb
CHANGED
@@ -543,4 +543,114 @@ class Queries
|
|
543
543
|
__typename
|
544
544
|
}"
|
545
545
|
end
|
546
|
+
|
547
|
+
def Queries.get_posts
|
548
|
+
"query PostsFeed($order: String, $after: String, $searchQuery: String, $languages: [String!], $count: Int, $boardSlugs: [String!], $pinAnnouncements: Boolean, $pinPinned: Boolean) {
|
549
|
+
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
|
+
items {
|
555
|
+
id
|
556
|
+
timeCreated
|
557
|
+
...PostsFeedItemPost
|
558
|
+
board {
|
559
|
+
id
|
560
|
+
color
|
561
|
+
name
|
562
|
+
__typename
|
563
|
+
}
|
564
|
+
__typename
|
565
|
+
}
|
566
|
+
__typename
|
567
|
+
}
|
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
|
+
}"
|
655
|
+
end
|
546
656
|
end
|
data/lib/repltalk.rb
CHANGED
@@ -282,4 +282,18 @@ class Client
|
|
282
282
|
)
|
283
283
|
Comment.new(self, c["comment"])
|
284
284
|
end
|
285
|
+
|
286
|
+
def get_posts(board: "all", order: "new", count: nil, after: nil, search: nil, languages: nil)
|
287
|
+
p = graphql(
|
288
|
+
"PostsFeed",
|
289
|
+
Queries.get_posts,
|
290
|
+
baordSlugs: [board],
|
291
|
+
order: order,
|
292
|
+
count: count,
|
293
|
+
after: after,
|
294
|
+
searchQuery: search,
|
295
|
+
languages: languages
|
296
|
+
)
|
297
|
+
p["posts"]["items"].map { |post| Post.new(self, post) }
|
298
|
+
end
|
285
299
|
end
|