Skip to content

Commit 56c54c9

Browse files
committed
Formatting
1 parent 7104abd commit 56c54c9

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

lib/queries.dart

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ! This file contains all SurrealQL queries used for @skyfeed.xyz custom feeds
22

33
final surrealQueries = {
4-
// ! Discover: Posts a user might enjoy, based on like history. Works by collecting your past likes of less popular posts, searching the network for users who have a similar like history, aggregating their recent likes and then ranking based on the sum of all the curator weights.
4+
// ! Discover: Posts a user might enjoy, based on like history. Works by collecting your past likes of less popular posts, searching the network for users who have a similar like history, aggregating their recent likes and then ranking based on the sum of all the curator weights.
55
'discover':
66
r'''LET $liked_posts = (SELECT ->(like WHERE createdAt > (time::now() - 168h) AND meta::tb(out) == 'post') as likes FROM $feeduserdid).likes.out;
77
LET $liked_posts2 = (SELECT * FROM (SELECT id, type::thing('like_count_view', [id]).likeCount AS likeCount FROM $liked_posts) WHERE likeCount > 1 ORDER BY likeCount ASC LIMIT 64).id;
@@ -31,11 +31,11 @@ SELECT id,createdAt FROM post WHERE record != NONE AND meta::tb(record) == 'feed
3131
'catch-up':
3232
r'select subject as id, likeCount from like_count_view where likeCount > 68 and subject.createdAt > (time::now() - 24h) order by likeCount desc limit 1000;',
3333

34-
// ! Catch Up Weekly: Most liked posts from the last 7 days
34+
// ! Catch Up Weekly: Most liked posts from the last 7 days
3535
'catch-up-weekly':
3636
r'select subject as id, likeCount from like_count_view where likeCount > 130 and subject.createdAt > (time::now() - 168h) order by likeCount desc limit 1000;',
3737

38-
// ! Art New: Powers the @bsky.art feed
38+
// ! Art New: Powers the @bsky.art feed
3939
'art-new':
4040
r'''LET $artists = (select ->follow.out as following from did:plc_y7crv2yh74s7qhmtx3mvbgv5).following;
4141
LET $posts = array::flatten(array::flatten((SELECT (SELECT ->posts.out as posts FROM $parent.id) AS posts FROM $artists).posts.posts));
@@ -44,12 +44,13 @@ LET $hashtag_posts = (SELECT ->usedin.out AS posts FROM hashtag:art).posts;
4444
return SELECT id,createdAt FROM array::distinct(array::concat($hashtag_posts,array::concat($posts,$reposts))) WHERE count(images) > 0 ORDER BY createdAt DESC LIMIT 1000;
4545
''',
4646

47-
// ! Mutuals: Posts from mutual follows
47+
// ! Mutuals: Posts from mutual follows
4848
'mutuals':
4949
r'''LET $res = (select ->follow.out as following, <-follow.in as follows from $feeduserdid);
5050
LET $mutuals = array::intersect($res.follows, $res.following);
5151
SELECT id,createdAt FROM array::flatten(array::flatten((SELECT (SELECT ->(posts WHERE createdAt > (time::now() - 168h)).out as posts FROM $parent.id) AS posts FROM $mutuals).posts.posts)) ORDER BY createdAt DESC LIMIT 1000;''',
52-
// ! Re+Posts: Posts and Reposts from people you are following
52+
53+
// ! Re+Posts: Posts and Reposts from people you are following
5354
're-plus-posts': r'''
5455
LET $following = (select ->follow.out as following FROM $feeduserdid).following;
5556
@@ -59,16 +60,16 @@ LET $posts = SELECT id,createdAt FROM array::flatten(array::flatten((SELECT (SEL
5960
SELECT * FROM array::concat($reposts,$posts) ORDER BY createdAt DESC LIMIT 1000;
6061
''',
6162

62-
// ! OnlyPosts: Only posts from people you are following, nothing else
63+
// ! OnlyPosts: Only posts from people you are following, nothing else
6364
'only-posts':
6465
r'''LET $following = (select ->follow.out as following FROM $feeduserdid).following;
6566
SELECT id,createdAt FROM array::flatten(array::flatten((SELECT (SELECT ->(posts WHERE createdAt > (time::now() - 72h)).out as posts FROM $parent.id) AS posts FROM $following).posts.posts)) ORDER BY createdAt DESC LIMIT 1000;''',
6667

67-
// ! What's warm: Posts with 6+ likes from the last hour
68+
// ! What's warm: Posts with 6+ likes from the last hour
6869
'whats-warm':
6970
r'SELECT subject as id, subject.createdAt as createdAt FROM like_count_view WHERE likeCount > 5 AND subject.createdAt > (time::now() - 1h) order by createdAt desc;',
7071

71-
// ! What's Reposted: Posts with 5+ reposts
72+
// ! What's Reposted: Posts with 5+ reposts
7273
'whats-reposted':
7374
'select id,createdAt from post where parent == NONE and createdAt > (time::now() - 6h) and count(<-repost) > 4 order by createdAt desc;',
7475
};

0 commit comments

Comments
 (0)