alpha
Login
or
Join now
flo-bit.dev
/
bluesky-wordcloud
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
[READ-ONLY] Mirror of https://github.com/flo-bit/bluesky-wordcloud. showing a wordcloud of all english bluesky posts in the last 10 seconds
flo-bit.dev/bluesky-visualizers/wordcloud
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
less waiting time
author
Florian
date
2 years ago
(Nov 19, 2024, 1:36 AM +0100)
commit
a01422e0
a01422e04d7564d299e2096fc42763903b643f91
parent
38b2a578
38b2a5780b2f0d6447d4d9c315e99c352b210638
+22
-5
1 changed file
Expand all
Collapse all
Unified
Split
src
routes
+page.svelte
+22
-5
src/routes/+page.svelte
View file
Reviewed
···
8
8
9
9
let posts = 0;
10
10
11
11
-
let countdown = 10;
11
11
+
let countdown = 3;
12
12
13
13
let firstCountdown = true;
14
14
···
227
227
228
228
updateDimensions();
229
229
230
230
-
setInterval(updateWords, 10000);
230
230
+
setTimeout(() => {
231
231
+
updateWords();
232
232
+
setInterval(updateWords, 10000);
233
233
+
}, 3000);
231
234
232
235
let countdownInterval = setInterval(() => {
233
236
countdown--;
···
240
243
241
244
window.addEventListener('resize', updateDimensions);
242
245
246
246
+
function secondsToMicroseconds(seconds: number) {
247
247
+
return Math.floor(seconds * 1000000);
248
248
+
}
249
249
+
250
250
+
const startTime = Date.now() * 1000 - secondsToMicroseconds(10);
251
251
+
console.log(startTime);
252
252
+
253
253
+
// WebSocket URL from BlueSky
243
254
const url =
244
244
-
'wss://jetstream2.us-east.bsky.network/subscribe?wantedCollections=app.bsky.feed.post';
255
255
+
'wss://jetstream2.us-east.bsky.network/subscribe?wantedCollections=app.bsky.feed.post&cursor=' +
256
256
+
startTime;
245
257
246
258
// WebSocket logic
247
259
const ws = new WebSocket(url);
···
289
301
});
290
302
291
303
function updateWords() {
292
292
-
console.log('Updating words');
293
304
// get 200 most common words
294
305
const mostCommonWords = Array.from(wordCounts.entries())
295
306
.sort((a, b) => b[1] - a[1])
···
329
340
<div
330
341
class="absolute left-0 top-0 flex w-full items-center justify-between px-4 py-2 text-sm font-semibold"
331
342
>
332
332
-
<div>by <a href="https://flo-bit.dev/" class="hover:text-cyan-600 transition-colors duration-100" target="_blank">flo-bit</a></div>
343
343
+
<div>
344
344
+
by <a
345
345
+
href="https://flo-bit.dev/"
346
346
+
class="transition-colors duration-100 hover:text-cyan-600"
347
347
+
target="_blank">flo-bit</a
348
348
+
>
349
349
+
</div>
333
350
334
351
<div>
335
352
<a